Very useful Linux tips and tricks.

This command will capture a screenshot of the desktop and save it to the home directory. jason@neo:~$ import -window root "$HOME/$(date ‘+%y%m%d_%T’).png"jason@neo:~$ import -window root "$HOME/$(date ‘+%y%m%d_%T’).png" This is how to do this with the scrot utility. jason@neo:~$ scrot Desktop-%H:%M:%S-%d-%m.jpgjason@neo:~$ scrot Desktop-%H:%M:%S-%d-%m.jpg Characters preceded by a ‘%’ are interpreted by strftime(2). See man strftime for … Read more

Some very useful Linux tips and tricks.

To read a file from the Internet using wget and print it in the terminal, use this command. ┌─[jason@jason-desktop]─[~/Documents] └──╼ $wget -qO – https://i.mjh.nz/au/Brisbane/raw-tv.m3u8┌─[jason@jason-desktop]─[~/Documents] └──╼ $wget -qO – https://i.mjh.nz/au/Brisbane/raw-tv.m3u8 View an image from the Internet with wget and the ImageMagik display utility. ┌─[jason@jason-desktop]─[~/Documents] └──╼ $wget -qO – https://i.4cdn.org/g/1603231784644.png | display┌─[jason@jason-desktop]─[~/Documents] └──╼ $wget -qO – https://i.4cdn.org/g/1603231784644.png … Read more

Very useful Ubuntu tips.

To get a nice warm screen color instead of a glaring white screen at night, use this very useful program. Redshift will remove blue light from your computer screen and then this will help with sleep. ┌─[jason@jason-desktop]─[/] └──╼ $sudo apt install redshift-gtk┌─[jason@jason-desktop]─[/] └──╼ $sudo apt install redshift-gtk Start Redshift from the Applications-Accessories menu and then … Read more

Some very old but still useful tips for Linux users.

Run the urxvt terminal as a transparent colored terminal window. This is very useful indeed. urxvt -fn "fixed" +sr +st -fg "#FFFFFF" -bg "#000033" -bd "#302c64" \ -ip +sb -title "*-Home-${HOME}-Shell-${SHELL}-Display-${DISPLAY}*" \ -tint DarkSlateGrey -fade 50 -fadecolor redurxvt -fn "fixed" +sr +st -fg "#FFFFFF" -bg "#000033" -bd "#302c64" \ -ip +sb -title "*-Home-${HOME}-Shell-${SHELL}-Display-${DISPLAY}*" \ -tint … Read more

Very useful bash shell tips for Ubuntu.

There are some tips for Ubuntu that are not as well known as they should be. One tip is searching the bash history. Press Control-R and a prompt will appear. (reverse-i-search)`sudo’: sudo apt-get install libxml2-utils(reverse-i-search)`sudo’: sudo apt-get install libxml2-utils Type a search like “sudo” for example, and the first search result will cope up, this … Read more

Very nice bash shell prompt and other useful Linux information.

Very nice bash shell prompt This is a very useful Linux shell prompt with color. export PS1="\[\033[38;5;165m\]\d\[$(tput sgr0)\] \[$(tput sgr0)\]\[\033[38;5;51m\]\W\[$(tput sgr0)\] \[$(tput sgr0)\]\[\033[38;5;84m\]\H\[$(tput sgr0)\]@\[$(tput sgr0)\]\[\033[38;5;229m\]\u\[$(tput sgr0)\]:\l>\[$(tput sgr0)\]\[\033[38;5;231m\]\\$\[$(tput sgr0)\] "export PS1="\[\033[38;5;165m\]\d\[$(tput sgr0)\] \[$(tput sgr0)\]\[\033[38;5;51m\]\W\[$(tput sgr0)\] \[$(tput sgr0)\]\[\033[38;5;84m\]\H\[$(tput sgr0)\]@\[$(tput sgr0)\]\[\033[38;5;229m\]\u\[$(tput sgr0)\]:\l>\[$(tput sgr0)\]\[\033[38;5;231m\]\\$\[$(tput sgr0)\] " This prompt will look like this. Mon Mar 30 ~ Yog-Sothoth@jason:0>$ This is … Read more

Various useful tips for using Ubuntu.

How to check the installed Ubuntu version with the command line. Use this command to check the installed version of the Ubuntu distribution. 4.4 Sat Mar 07 jason@Yog-Sothoth 0: $ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=18.04 DISTRIB_CODENAME=bionic DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"4.4 Sat Mar 07 jason@Yog-Sothoth 0: $ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=18.04 DISTRIB_CODENAME=bionic DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS" This is another … Read more

It is very useful to have knowledge of the command line. Here are some useful tips for you.

If you need to perform a command a second time on a different file, you can use command replacement with the ^ symbol. e.g. cp foo.txt /to/some/directory then ^foo^bar, expanding to: cp bar.txt /to/some/directory. To find information about a particular command, the apropos utility can be very helpful, this will search the system and find … Read more

Very useful Linux shell tips and tricks.

Add a new directory to the PATH to allow running an application from it without typing the full path every time you wish to run it. PATH=$PATH:/usr/local/binPATH=$PATH:/usr/local/bin Or you may have something like this in your .bashrc to add this every time you log in. PATH="/home/jason/perl5/bin${PATH:+:${PATH}}"; export PATH;PATH="/home/jason/perl5/bin${PATH:+:${PATH}}"; export PATH; This can also be set … Read more

Linux security considerations to lock down a shared server.

SSH keysVirtual Private NetworkUse sudo instead of suVulnerability updatesLogin failure delayIptablesPasswords Securing a Linux server is very important. There are many attacks against UNIX servers and the security of corporate networks must be protected by many layered security devices and comprehensive security plans to deal with any problems experienced by network administrators due to a … Read more

Use sed to filter text, this is very useful.

This sed sample will filter out all HTML opening and closing tags in HTML sed -e ‘s/<[^>]*>//g’ blog.txtsed -e ‘s/<[^>]*>//g’ blog.txt This is an example of the usage of this one-liner. 4.4 Sun Nov 11 jason@Yog-Sothoth 0: $ sed -e ‘s/<[^>]*>//g’ index.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">   Securitron GNU/Linux pages.   … Read more

Very useful tips for all Linux users. Good to know for anyone using Ubuntu or Mint.

There are many ways to list directories and sort the results by size. I have just found another way. Use the ls command with the -S parameter. This sorts files by size. Very useful way to get the largest files in a certain directory. Linux has so many varied methods of listing files, it is … Read more