Archive for the ‘Debian-Testing’ Category:

How to search the apt packages list for a certain package.

The apt command allows the user to search for a specific package. This is very useful if you do not know the exact name for package installation.

This is one way.

ubuntu ~ $ apt-cache search vim

This will return a long listing of all matching package names.

This is another way. This will return a listing of all matching packages with a short one sentence description.

ubuntu ~ $ apt search vim

This is how to filter the output to get better results. Here I am looking for all VIM editor packages.

ubuntu ~ $ apt-cache search vim | grep editor
vim - Vi IMproved - enhanced vi editor
vim-dbg - Vi IMproved - enhanced vi editor (debugging symbols)
vim-gnome - Vi IMproved - enhanced vi editor - with GNOME2 GUI
vim-tiny - Vi IMproved - enhanced vi editor - compact version
editmoin - edit MoinMoin wiki pages with your favourite editor
elvis-tiny - Tiny vi compatible editor for the base system
vim-addon-manager - manager of addons for the Vim editor
vim-athena - Vi IMproved - enhanced vi editor - with Athena GUI
vim-gtk - Vi IMproved - enhanced vi editor - with GTK2 GUI
vim-lesstif - Vi IMproved - enhanced vi editor (transitional package)
vim-nox - Vi IMproved - enhanced vi editor - with scripting languages support
vim-vimoutliner - script for building an outline editor on top of Vim

Very easy to do.

Another example.

Results of apt cache search.

Results of apt cache search.

This is a very good thing to know when you are stuck with a package that you cannot remember the name of.

Send a message to logged in Linux users and other nice tricks.

To send a message to logged in Linux users with the wall command, just open it and type a message. Then press ^D to send it.

jason$ wall
Hi
 
Broadcast message from jason@jason-desktop (pts/0) (Sat Aug 27 22:24:05 2016): 
 
Hi

This is useful for messaging users about an upcoming server restart or maintenance.

If the user was not using a terminal window or a VT, they would not see the message, so use this instead. Xmessage will pop up a message on the user`s desktop. That way they will get the message.

22:28:23 0 ~
jason$ export DISPLAY=':0.0'
 
22:29:00 0 ~
jason$ xmessage "Server restart in 10 min."

This is what it looks like.

Xmessage displaying a message from a server admin.

Xmessage displaying a message from a server admin.

Another way is using the write command. This requires the user to give it the username and the TTY the user is logged into. This is only useful if you actually know that a user is on a terminal or TTY and which one.

09:57:59 1 ~
jason$ write jason /dev/pts/0
 
Message from jason@jason-desktop on pts/0 at 09:58 ...
Hello
Hello
EOF

If I try to message a terminal with noone on it I get this error..

09:58:14 0 ~
jason$ write jason /dev/tty2
write: jason is not logged in on tty2

But this is still useful. The wall or warn all command is the best for messaging users that are in terminals, and the xmessage command for messaging users in a desktop environment. Good ways to warn users of upgrades or server maintenance.

Australian Census website goes down under the strain.

I hate Windows 10.

I hate Windows 10.

The Australian Census website went down under the strain of usage and the government is blaming foreign cyber-attackers for the problems when it is to do with the inability to deal with the amount of traffic that came to the website on the census night. Of course, I did mine in advance and had zero problems, but the other people that tried to do their census on the night have had huge problems. This is why the server should have been load tested before the night, this would have revealed problems with the bandwidth and load capacity of the web server. There are tools available to load-test servers before they are needed for a major requirement such as a census night. That would have not required much effort at all, but this is the Australian government we are talking about here. Apparently, they are now saying this was not an on-line attack after all, but what a bungle it is. That is why websites that are intended for a heavy load should be distributed to handle the load. Blaming “overseas attackers” for your own IT failings is not the best way to handle this situation.

OCP facepalm.

OCP facepalm.

Building better IT infrastructure for Australia should be a goal for the 21st century, but this has fallen by the wayside. Our Internet infrastructure lags behind many other countries and we are selling everything off to foreign buyers. Independent Senator Nick Xenophon, who last week called for the Census to be delayed because of growing concerns about its roll-out, security and the readiness of the ABS, said the census was “a monumental failure of a government program of the first order’’. “In response to my calls for a delay the Government and the ABS were dismissive of my concerns. They said everything was OK,’’ he said. This is a huge embarrassment for the Australian government. I wonder what will happen if they want to move the Election voting on-line… It would be fun to watch that is for sure. Malcolm Turnbull sought to assure Australians their census data was “safe” and had not been “compromised” but admitted that some of the Australian Bureau of Statistics “defenses” had clearly “failed” last night. He said the ABS’ decision to close down the census on-line site was “taken out of an abundance of caution”. So the website was shut down due to overload, but it should have been able to handle the expected load, but it could not. This is a failure in planning, they should have known what load the server was expected to take. They should learn their lesson from this and do a better job next time.

Funny Linux photograph, this is in a supermarket.

Linux filesystem error in a supermarket.

Linux filesystem error in a supermarket.

This is a photograph captured in a supermarket. This shows a Linux machine that must be meant for showing advertisements or other videos and it is instead depicting a Linux bootup error. The filesystem has an inconsistency and this means that the fsck utility must be run manually to fix the error. Not a major issue as long as the drive is not failing. If it is a magnetic drive, this means that you hear a click of death, this means back up all data and replace it right away. But this machine is running Gentoo Linux, I have had a lot of issues with that distribution. Better to run Fedora in a business environment. Although Ubuntu Server is very good.

Below is another picture, an ATM running Windows 7. This machine is asking for Windows activation. Please just enter the product key…

Windows 7 activation on an ATM machine.

Windows 7 activation on an ATM machine.

Linux Terminal command to format PGP to properly display on reddit.

So it was brought to my attention that a command in Linux exist that makes what I made obsolete. Here is the code you can run in the terminal. Simply save your PGP message, name it something, and place it on your Desktop and replace FILENAME with the name of the file you saved the PGP message as.

cat ~/Desktop/FILENAME | sed 's|^|    |g'

then it will print the formatted message into the terminal, highlight it and right click and click “copy” ctrl+c does not copy inside terminal.

How to block access to the .htaccess file on an Apache web server.

Blocking access to the .htaccess file on your Apache web server blocks access to the file by curious web users that want to see what directives are in it. The code below added to the .htaccess file will forbid all access to the .htaccess file by web users while still allowing it to function.

#Deny attempts to view the Htaccess file.
<Files .htaccess>
Order allow,deny
Deny from all
</Files>

Very important to add this code when setting up your web server.

Count the actual lines of code in your C or C++ project.

This is how to actually count the lines of code in your C project on Linux. Some people advocate using wc -l, but that would not suit our purposes. The cloc utility is able to do this and more.

Firstly, install this utility.

sudo apt install cloc

Then run the utility in a source folder.

jason@jason-desktop:~/Documents/ipinfo/src$ cloc .
       2 text files.
       2 unique files.                              
       0 files ignored.
 
http://cloc.sourceforge.net v 1.60  T=0.01 s (138.5 files/s, 11358.2 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
C/C++ Header                     1             13             10             66
C                                1             14              8             53
-------------------------------------------------------------------------------
SUM:                             2             27             18            119
-------------------------------------------------------------------------------

This utility shows the number of files, the lines of actual code, and the comments. Very useful for keeping track of how big your project is. It also shows a summary row with the totals at the bottom.

Use the –strip-comments=.strip parameter to write copies of the files with all comments and blank lines edited out.

jason@jason-desktop:~/Documents/ipinfo/src$ cloc . --strip-comments=.strip
       2 text files.
       2 unique files.                              
Wrote info.h..strip
Wrote ip.c..strip
       0 files ignored.
 
http://cloc.sourceforge.net v 1.60  T=0.01 s (286.3 files/s, 22190.6 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
C                                1              0              0             66
C/C++ Header                     1             13             10             66
-------------------------------------------------------------------------------
SUM:                             2             13             10            132
-------------------------------------------------------------------------------

Very useful for making a simplified C source file, but having comments in the file is very useful when someone else has to take on your code.

How to login as root on Ubuntu 16.04.

To login as root on Ubuntu 16.04, open the terminal and type this command.

[email protected]:~$ sudo su -
[sudo] password for jason: 
[email protected]:~#

This will give you a root prompt. Then enter this command to unlock the root account.

[email protected]:~# passwd root
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully

This allows the user to set a password for the root user and unlock the account. A very useful tip to make full use of your machine.

Now it works.

[email protected]:~$ su
Password: 
root@jason-desktop:/home/jason#

Linux commands cheat sheet.

Linux commands cheat sheet.

With this list of basic Linux commands and sample usages, you’ll never have to worry about forgotten commands again. The items contained within brackets are optional, and type man at a shell for more information.

Ubuntu pocket guide.

Ubuntu Pocket Guide and Reference (PDF Edition)

Linux Mint users guide. Very useful for all Linux Mint fans.

Linux Mint users guide. Very useful for all Linux Mint fans.

The Debian Administrator’s Handbook.

The Debian Administrator’s Handbook.

Linux Fundamentals.

Linux Fundamentals ebook.

Linux just as important as ever in the modern world.

Windows 10 is the current operating system that Microsoft are pimping, but Linux is still very important. Servers run the free operating system, and there are many jobs that require Linux administration experience. The Windows 10 bash shell cannot run server software such as Apache and MySQL, this means that an actual Linux machine is required to run an actual server. This way, Samba or a LAMP stack may easily be run on a much more secure machine than a patched together Windows Server operating system. Linux on a cloud instance such as Amazon AWS or a cheap VPS allows the user to construct an OpenVPN server, or route E-Mail. Free software is a better option than closed source software. Teamviewer is closed source and this has many security vulnerabilities. Apparently having this software installed leads to security compromises on your computer. Not a good thing at all. That is why anyone wanting to share their desktop should use VNC instead. I have never used Teamviewer and I do not intend to. Here is a list of security vulnerabilities in this software, showing that it has a long way to go before it is usable as a secure product over the Internet.

The teamspy backdoor is a malicous DLL file that is shipped with Teamviewer and allows crackers to gain unwanted access to a target computer. This goes to show that anyone that wants to download Teamviewer should only download it from a reputable website. Other sites may tamper with the download to slipstream malware into the download. That is why Linux is making inroads into the computing market. Software is available from secure repositories and these are signed, this ensures that the software you are installing is actually what you wanted. Especially when installing a SSH server or the OpenVPN client. That is why keys need to be installed when adding a PPA to a Debian distribution. This allows the installation of signed packages from a users repository. Of course, this is also possible with Windows software, if the user downloads from a reputable website and then checks a SHA hash to make sure the file is what the user expects to be downloading. Do nto download from websites that require a downloader to download the file. I always go somewhere else and find a proper download. Linux has the advantage of a proper package manager. Sure, you can turn Windows features on and install certain files, but the Apt and YUM package management systems are way better.

For those interested in the new Bash environment, there is documentation on the Microsoft website: https://msdn.microsoft.com/commandline. And there is some user feedback here: https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/category/161892-bash.

Incredible new wallpapers for your Linux or Windows machine.

Some nice wallpapers to improve your desktop.

Bern, 3840×2160: https://www.reddit.com/r/wallpapers/comments/4lql1n/bern_3840x2160/.

Forest Path. [3840×2160]: https://www.reddit.com/r/wallpapers/comments/4lp77g/forest_path_3840x2160/.

Chicago [3840×2400]: https://www.reddit.com/r/wallpapers/comments/4lhiwv/chicago_3840x2400/.

Amanita Muscaria [4160×3120]: https://www.reddit.com/r/wallpapers/comments/4l1hij/spring_has_sprung/.

The Great Blue Hole [1920×1200]: https://www.reddit.com/r/wallpapers/comments/4kujhu/the_great_blue_hole_1920x1200/.

Portland sunrise: https://interfacelift.com/wallpaper/details/4053/portland_sunrise.html.

View out the window of the Space Shuttle: https://www.desktoppr.co/wallpapers/726988.

Fort Worth gardens: https://www.desktoppr.co/wallpapers/726924.

Sewage pond 1440×900: https://4walled.cc/show-102573.

Amish buggy on country road: https://4walled.cc/show-467432.

Running track winding across a field: https://4walled.cc/show-96730.

Windows 10 nag screen close button was starting the upgrade.

The Windows 10 nag screen was using a dirty trick that involved having the close button to start the installation. This is very annoying, firstly, you click the upgrade now button and it starts the upgrade, but now the close button was starting the upgrade? That is one dirty trick indeed. Why are Microsoft so desperate for everyone to upgrade to Windows 10 anyway? Forcing these updates on everyone will not curry favor with more paranoid users. Of course, they are the company responsible for the Metro/Modern UI start screen in Windows 8. That was an unforgivable User Interface invention. Windows 8 as a whole was very strange. Just like using Android x86 on a eePC. A mobile phone interface does not work well on a PC. I cannot believe that the Windows 8 styled start screen was in Windows Server 2012. Why would a server operating system need a mobile phone UI? So many computers have had serious issues with running the upgrade and rebooting into an unusable state. That is unacceptible in 2016. That is why I will stay with Windows 7 for the time being.

Windows 10 nag screen.

Windows 10 nag screen.

This posting has a solution for Windows 7 and 8 that will prevent Windows 10 automatic updates. This will be very useful if your machine is fine the way it is and you do not wish to run Windows 10 at all. GWX Control Panel is the easy way to protect your machine from Windows 10. Having something like the below screenshot happen to you would really suck. This guy was livestreaming a counterstrike gaming session and his computer automatically restarted into a Windows 10 upgrade. That ridiculous. That is why you block the upgrade crap.

Livestream interrupted by Windows 10 upgrade.

Livestream interrupted by Windows 10 upgrade.

What is new in the Ubuntu 16.10 release.

Ubuntu Desktop 16.10 Yakkety Yak Daily Build 29-04-2016.

Here is a good little program I wrote in C. Just for fun.

Not a bad little program, and I got the code to work first time, not bad. Writing code in standard C is better than C++ or C#, the old C language is still the best. The whole Linux kernel is written in C and if it is good enough for that project, it is good enough for me.

 
#include <stdio.h>
 
#define EQ ==
#define OP "Troll."
#define trololol printf
 
int lineofstars (void) {
	int x = 0;
	while (x < 64) {
		printf("*");
		x++;
		if (x EQ 31) {
			printf("<|>");
		} else if (x EQ 64) {
			printf("\n-\n");
		}
	}
}
 
int main (int argc, char** argv) {
 
	char *name;
	name = "OP";
	lineofstars();
	trololol("According to this, %s is a %s\n", name, OP);
	return 0;
}

Musings on Linux in general.

Gentoo works perfectly well as a desktop operating system, I have Sabayon Linux which is based on Gentoo and would be good, as long as the Network manager works just as well as it does in Ubuntu and Linux Mint. Wicd is not as good as Networkmanager when it comes to using Wireless Broadband. I need to get another Wireless Broadband dongle, my last one broke and I am using the town library Internet as I write this, I am updating from Ubuntu 10.04 to Ubuntu 10.10, I edited the /etc/apt/sources.lst and replaced all instances of lucid to maverick and typed sudo apt-get update && sudo apt-get upgrade and I can upgrade to Ubuntu Maverick 10.10 that way. Sure it takes a long time downloading more than 323 megabytes of packages, but it is worth the effort, and better than downloading a 700MB CD and installing that then downloading about 400MB of updates. I stand by this method. I wish you could upgrade from the Ubuntu CD’s from Lucid to Maverick, but you cannot. That is stupid, you could do an upgrade from XP to Vista or Windows 7, and keep the old data in the Windows.Old folder, why can’t you do that in Ubuntu? Unless you have a separate /home partition and you can re-install the newer version of Ubuntu and keep your user data. I used to do that a lot, you keep all of your user data and settings and just install a different Linux distribution and tell it to mount the partition as /home. That is a pretty foolproof way to do it, but then you lose all of the extra software you have installed and an upgrade could see what you have installed and upgrade it to the latest versions.

Canonical are you listening? You need to get with the times and see how things should be done, and if the upgrade goes wrong, ie a power failure, then you should be able to recover from that and get it finished. I guess they might go this way in the future, and put in place some kind of system to handle updating. I know they used to pop up a notification where you were prompted to upgrade to a newer version of Ubuntu, I prefer to do it with the command line as I am used to performing tasks that way.

The Linux flash plugin sure is linked with a lot of stuff as a lot of Linux stuff is. But it is interesting to look at this sort of thing and if you are writing a program, it would be interesting to try and reduce the amount of libraries your executable is linked to.

[email protected]:~$ ldd /usr/lib/flashplugin-installer/libflashplayer.so
	linux-gate.so.1 =>  (0x00c36000)
	libX11.so.6 => /usr/lib/libX11.so.6 (0x00110000)
	libXext.so.6 => /usr/lib/libXext.so.6 (0x007fb000)
	libXt.so.6 => /usr/lib/libXt.so.6 (0x00444000)
	libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x0022d000)
	libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x002a3000)
	libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0x002d3000)
	librt.so.1 => /lib/tls/i686/cmov/librt.so.1 (0x009bd000)
	libgtk-x11-2.0.so.0 => /usr/lib/libgtk-x11-2.0.so.0 (0x1e514000)
	libgdk-x11-2.0.so.0 => /usr/lib/libgdk-x11-2.0.so.0 (0x002ec000)
	libatk-1.0.so.0 => /usr/lib/libatk-1.0.so.0 (0x00382000)
	libpangoft2-1.0.so.0 => /usr/lib/libpangoft2-1.0.so.0 (0x0039e000)
	libgdk_pixbuf-2.0.so.0 => /usr/lib/libgdk_pixbuf-2.0.so.0 (0x003c5000)
	libpangocairo-1.0.so.0 => /usr/lib/libpangocairo-1.0.so.0 (0x003df000)
	libcairo.so.2 => /usr/lib/libcairo.so.2 (0x00497000)
	libpango-1.0.so.0 => /usr/lib/libpango-1.0.so.0 (0x003eb000)
	libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0x00511000)
	libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0x0042e000)
	libglib-2.0.so.0 => /lib/libglib-2.0.so.0 (0x00550000)
	libssl3.so => /usr/lib/libssl3.so (0x0087b000)
	libsmime3.so => /usr/lib/libsmime3.so (0x008c3000)
	libnss3.so => /usr/lib/libnss3.so (0x0061a000)
	libplds4.so => /usr/lib/libplds4.so (0x00a49000)
	libplc4.so => /usr/lib/libplc4.so (0x0098e000)
	libnspr4.so => /usr/lib/libnspr4.so (0x0072e000)
	libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0x007b2000)
	libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0x00763000)
	libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x00a4d000)
	/lib/ld-linux.so.2 (0x009e4000)
	libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00789000)
	libSM.so.6 => /usr/lib/libSM.so.6 (0x00433000)
	libICE.so.6 => /usr/lib/libICE.so.6 (0x007b6000)
	libz.so.1 => /lib/libz.so.1 (0x007cf000)
	libexpat.so.1 => /lib/libexpat.so.1 (0x0080b000)
	libXrender.so.1 => /usr/lib/libXrender.so.1 (0x007a3000)
	libXinerama.so.1 => /usr/lib/libXinerama.so.1 (0x0043c000)
	libXi.so.6 => /usr/lib/libXi.so.6 (0x007e4000)
	libXrandr.so.2 => /usr/lib/libXrandr.so.2 (0x007f2000)
	libXcursor.so.1 => /usr/lib/libXcursor.so.1 (0x00832000)
	libXcomposite.so.1 => /usr/lib/libXcomposite.so.1 (0x00440000)
	libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0x007ad000)
	libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x00959000)
	libgio-2.0.so.0 => /usr/lib/libgio-2.0.so.0 (0x09e46000)
	libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0x0083f000)
	libpixman-1.so.0 => /usr/lib/libpixman-1.so.0 (0x008e9000)
	libdirectfb-1.2.so.0 => /usr/lib/libdirectfb-1.2.so.0 (0x00ba7000)
	libfusion-1.2.so.0 => /usr/lib/libfusion-1.2.so.0 (0x00845000)
	libdirect-1.2.so.0 => /usr/lib/libdirect-1.2.so.0 (0x0084f000)
	libpng12.so.0 => /lib/libpng12.so.0 (0x0095f000)
	libxcb-render-util.so.0 => /usr/lib/libxcb-render-util.so.0 (0x00865000)
	libxcb-render.so.0 => /usr/lib/libxcb-render.so.0 (0x0086a000)
	libpcre.so.3 => /lib/libpcre.so.3 (0x00a01000)
	libnssutil3.so => /usr/lib/libnssutil3.so (0x00993000)
	libXau.so.6 => /usr/lib/libXau.so.6 (0x00c23000)
	libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00872000)
	libuuid.so.1 => /lib/libuuid.so.1 (0x008ad000)
	libresolv.so.2 => /lib/tls/i686/cmov/libresolv.so.2 (0x00943000)
	libselinux.so.1 => /lib/libselinux.so.1 (0x009c6000)
[email protected]:~$

My little ping app is not linked to too much in comparison is it?

shoggoth@shoggoth:~/Documents$ ldd ./pingme
	linux-gate.so.1 =>  (0x0034b000)
	libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x00de0000)
	/lib/ld-linux.so.2 (0x0018c000)

Will we ever completely replace the hard drive?

I  am wondering, if due to the popularity of the SSD solid state hard drives, are we going to see the end of the conventional hard disk with metal platters and read-write heads that skitter over the surface floating on a cushion of air. The SSD drives are getting better and better but do not have the capacity to match a standard hard disk. I would love to have a SSD if it had at least a 500GiB capacity and extremely fast read and write speeds, enabling a super fast boot time with Debian. They would only be very useful if they were reliable and long lasting. The TRIM function required by SSD drives on Linux is included in the 2.6.33 kernel and the ext4 filesystem is desired for installation on an SSD drive. Even if you did not install all of the operating system on the SSD, it would make an extremely good boot drive if you put the /boot partition on it then it could load the kernel & initrd off the fast solid state drive and that would boot the system very fast. If you included /lib on the SSD that would help as well.

Debian starts very fast with the 2.6.38.2 kernel supplied with Debian Unstable and this is the most recent kernel from the stable branch. Debian Unstable is the Debian repository for the latest versions of software that is not available in the Debian Stable repository, but the software in that branch in my experience is just as stable and reliable. Debian has come a long way since the Debian 3.0 “Woody” release on the 19th of July 2002. I have used that and it was extremely reliable and usable. The KDE 2 desktop was light years ahead of the bloated mess that it is now and the Konqueror file manager was preferable to the Dolphin file manager that KDE 4.5 uses now. And the text mode installer with ncurses screens was not too hard to use, the only hard thing was using dselect, but that just takes experience. Debian 6.0 with the graphical installer is even easier to setup and get working. You can just download the minimal installation ISO and install the rest of the packages from the http or an ftp site, but I downloaded the 4.3 GiB DVD ISO and installed Debian from that. The Youtube video I have included shows an old laptop loading Debian Linux 3.0 which takes me back. I have even had Xandros linux installed one time which was also a very good and fun Linux distribution.

Then there was Lindows Linux, which was re-named Linspire which was aimed at new users of Linux and gave people a stable and easy to use Linux desktop using KDE.