how to generate long random numbers with the Linux command line.

This simple command prints out a long random number string from /dev/urandom. jason@Yog-Sothoth » img » $ tr -dc "[:digit:]" < /dev/urandom | head -c 64 ; echo 9958048462925775253231939134565711861924198983498274782350446110 Do it this way to remove the newline after the output. This would be good for use in a script. jason@Yog-Sothoth…

Read More

Interesting one-liner to batch rename files.

This is a very interesting one-liner. This will batch rename files according to wildcards. jason@Yog-Sothoth » Pictures » $ for i in *.png; do mv -vi — "${i}" "$(date +%s%3N).${i#*.}"; done This renames files with a filename generated using the UNIX epoch. I guess this could be useful to someone…

Read More

Very useful Arma 3 code for mods and missions.

A code sample that creates a weapon box with some ammo. Just change the class names to add a weapon of your choice to this box. class cfgVehicles { class Thing; class ThingX; class ReammoBox; class Strategic; class EAST_Box_Base; class NATO_Box_Base; class Railgun_Transport_Box: EAST_Box_Base { scope = 2; vehicleClass =…

Read More

Restore the files in /etc/skel if they have been deleted.

The files in /etc/skel are for the creation of new user accounts, but if they are deleted accidentally, they are no good no anyone. This is how to re-download these files and restore them. Firstly, download the bash package to an empty directory. ason@Yog-Sothoth » bash » $ apt download…

Read More

Very annoying things that happen when using WordPress.

I hate it when a plugin author updates their plugin and upon updating it, you get a PHP error that prevents you from running your website, necessitating that you log into your Cpanel to fix the problem. That is great. Why can they not test the plugin first before deploying…

Read More

Control which GTK theme a specific application uses on Linux.

This post will show you how to open a certain GTK application, like Gedit or Firefox, and force it to use a certain GTK theme. This example uses the Gedit editor. I am opening the editor using the BlackMATE theme. jason@Yog-Sothoth » ~ » $ env GTK_THEME="BlackMATE" /usr/bin/pluma   (pluma:5423):…

Read More

How to add a lecture that appears every time sudo is run.

To add a lecture that appears when sudo is run to remind a user to be careful, just run the sudo visudo command and add these two lines to the /etc/sudoers file. Defaults lecture="always" Defaults lecture_file="/root/lecture"Defaults lecture="always" Defaults lecture_file="/root/lecture" Save the file and then add this text to the /root/lecture…

Read More

How to use rsync to list filenames in a directory on a remote Linux server.

The rsync command with the –list-only parameter allows the user to list filenames on a remote machine. But by default, it looks like this. jason@Yog-Sothoth » ~ » $ rsync –list-only [email protected]:/home/jason/Documents/ [email protected]’s password: drwxr-xr-x 4,096 2018/05/09 09:49:49 . -rw-r–r– 867,863 2018/04/19 12:44:56 altis_insurgency_altis.pbo -rw-rw-r– 681,638 2018/05/04 09:03:16 pg768.txt -rwxrwxr-x…

Read More

How to get a good old fashioned text boot with Ubuntu 18.04.

This GRUB config in the /etc/default/grub file will give a good old-fashioned text boot instead of the graphical bootsplash that we are all familiar with. This works very well on my system, and the user can see exactly what is happening when the machine is booting up. This allows the…

Read More

How to have a custom bash prompt that changes when you are in a certain folder.

This is how to create a custom bash prompt that will change if the user is in a certain folder, but is standard anywhere else. PS1="┌─╼ \$(if [[ \$PWD/ = \$HOME/anime/* ]]; then \ echo \"\[\e[1;35m\](\[\e[0;35m\] •\[\e[1;35m\]^ ω ^) \[\e[1;34m\]\$(pwd | sed ‘s|’$HOME/anime/’|アニメ |; s|’$HOME/anime’|アニメ |’)\[\e[0m\]\" \ ; else \…

Read More

Get information about running services with systemd on Ubuntu 17.10.

This is an easy way to get information about running services on your Ubuntu machine. I am after user services, so I am using systemctl to get this information. This is very easy. Get information about a certain service. jason@kaio:~$ systemctl status –user pulseaudio ● pulseaudio.service – Sound Service Loaded:…

Read More