The date is: 2016/05/06 07:27:27.



Some useful Linux scripts for the desktop Linux user who likes the command line.

There are many useful Linux tips that make the life of a Linux user much easier. One is for the VI or VIM editor. To open a file at a specific line; use this command. homer@deusexmachina ~/Documents/yadex-1.7.901 $ vim src/x11.h +33 This will open the file x11.h at line 33. How to ssh into a […]

How to copy files from one machine to another using SSH and the sftp command.

The sftp command allows a user to retrieve files on a remote machine and save them on their computer. Use this command to access the files: sftp -P 443 homer@192.168.100.2:/home/homer/Downloads/*.pdf I have my SSH server running on port 443, so I need to specify that port when using this command. I am using Cygwin on […]

Useful shell script that may be used to create a whole host of user accounts easily.

This bash shell script is useful for creating a new user and setting a password for that user. This allows you to just type a username and password and everything else is done for you. Very useful for someone who is in a hurry. #!/bin/bash echo “Type a username for your new account: ” read […]

How to use the touch command to create a file with an arbitrary filename.

The touch command ordinarily does not allow the user to create files with a filename like –rf, but if you want to really annoy someone then you may use this command to create one. homer@debian:~$ touch — ‘–rf ‘ And now you have a file named –rf. -rw-r–r– 1 homer homer 0 Jun 28 16:26 […]

A quick look at redirection in the bash shell.

The bash shell allows the user to redirect output from one application to another or to a file. This is very useful when you are building a one liner script to perform a certain action. Here is a simple redirection. ls > ls.out This redirects the output of the ls command to a file that […]

How to change the default plymouth theme manually on Ubuntu 14.10.

Changing the default plymouth theme on Ubuntu 14.10 is not very difficult. Just type this at the shell prompt. This will set the new theme. root@homer-eME730:~# update-alternatives –install /lib/plymouth/themes/default.plymouth default.plymouth /lib/plymouth/themes/ubuntustudio-logo/ubuntustudio-logo.plymouth 100 Now we need to save our changes. root@homer-eME730:~# update-alternatives –config default.plymouth There are 5 choices for the alternative default.plymouth (providing /lib/plymouth/themes/default.plymouth). Selection Path […]

Some useful Linux commands and tricks for the bash shell user.

The boxes utility for Linux allows you to render an ascii text box around text. Below is an example. homer@homer-eME730 19:14:21 ~ $ echo `echo "This is a sentence printed to the terminal."` | boxes /***********************************************/ /* This is a sentence printed to the terminal. */ /***********************************************/ This is a useful utility if you want […]

Useful Macintosh OSX terminal commands to get information about your iMac.

The mount command shows information about your mounted partitions on your machine. iMac305:~ admin$ mount /dev/disk0s2 on / (hfs, local, journaled) devfs on /dev (devfs, local, nobrowse) map -hosts on /net (autofs, nosuid, automounted, nobrowse) map auto_home on /home (autofs, automounted, nobrowse) map -fstab on /Network/Servers (autofs, automounted, nobrowse) /dev/disk0s3 on /Volumes/Scratch (hfs, local, journaled) […]

Using tcpdump to capture packets with a wireless connected computer.

Use this command to capture packets with the tcpdump command. This will output to STDOUT, but you may use redirection to divert it to a text file. [root@deusexmachina homer]# tcpdump -i wlp2s0 This is the output that you get when you are capturing packets. This is on my home network, so there are not many […]

More useful shell tricks for bash. These are very useful tricks for any Linux user.

This sed trick will filter out the unwanted characters and leave only the letters ‘A’. homer@deusexmachina ~ $ echo “###AAA” | sed ‘s/###//gi’ AAA This is how to re-bind the annoying CAPS-Lock key to Esc. This can give that key a new use. xmodmap -e ‘clear Lock’ -e ‘keycode 0x42 = Escape’ & Here is […]

Some miscellaneous Linux commands for the desktop user.

Find all files larger than 1 megabyte in a directory. find . -maxdepth 1 -type f -size +1M -printf “%f:%s\n” | sort -t”:” -k2 Search a file for a certain string. grep “hello” my.txt Get the hostname from an IP address. Homer@bejiitas – $ ipcalc -h 74.125.237.194/24 HOSTNAME=google.com Use wildcards on the command line to […]

A useful posting explaining why Linux does not need defragmenting.

If you are interested in how the Linux filesystem works, then this is a posting you really need to read: http://geekblog.oneandoneis2.org/index.php/2006/08/17/why_doesn_t_linux_need_defragmenting. This is a posting explaining how the Linux filesystem stores file and why it does not need to defragment the filesystem as it stores files more efficiently. I have never wanted to defragment a […]

Strange but useful shell trick with the bash shell.

This is a very strange shell trick that allows you to have a set of parameters to a Linux command that are separated by single quotes. [homer@localhost ~]$ df -h’l’a’T’ Filesystem Type Size Used Avail Use% Mounted on rootfs rootfs 216G 75G 130G 37% / proc proc 0 0 0 – /proc sysfs sysfs 0 […]

Some very cool Linux shell tips and tricks for old and new users alike.

Some very useful Linux shell commands and tricks. Print numbers in sequence. [homer@localhost ~]$ seq 8 24 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Print numbers in sequence, but only multiples of 8. [homer@localhost ~]$ seq 8 8 128 8 16 24 32 40 48 […]

Linux commands to find out hardware information.

Linux hardware information commands. There are many commands available for Linux that allow the user to get information about their hardware. Here is a handful of them. The lshw command. deusexmachina description: Notebook product: eME730 (Calpella_CRB) vendor: eMachines version: V1.15 serial: LXN98020810441E9781601 width: 64 bits capabilities: smbios-2.6 dmi-2.6 vsyscall32 configuration: boot=normal chassis=notebook family=Intel_Mobile sku=Calpella_CRB uuid=40198687-F9A4-2099-05F2-88AE1D6D09BC […]