Ubuntu |
These notes are my personal online notebook of useful commands and "how-to's". You are welcome to make use of them if you find them helpful. They obviously don't come with any warranty! Click on one of the category tags above for the notes in any category. |
|||
If the system has been corrupted, and there is no grub menu, then boot from a live CD, open a terminal and do this: sudo fdisk -l # find the root filesystem sudo mount /dev/sda2 /mnt #whatever your root filesystem is D1=dev D2=dev/pts D3=proc D4=sys sudo mount --bind /$D1 /mnt/$D1 && sudo mount --bind /$D2 /mnt/$D2 && sudo mount --bind /$D3 /mnt/$D3 && sudo mount --bind /$D4 /mnt/$D4 sudo chroot /mnt # You are now back in the main hard drive cd /etc/default cp grub grub.orig vi grub # change timeout from 0 to 10 # change STYLE from hidden to menu # remove # from Ter |
|||
To securely wipe a hard drive of all data, do: apt install wipe shred -vfz -n 2 /dev/sdb
An alternative “light” way of doing this is to simply copy random bytes D=sdb fdisk -l /dev/$D # make sure we have the right device dd if=/dev/urandom of=/dev/$D bs=4096 status=progress
pgrep -l '^dd$' # gives the pid: nnnn DD watch -n 60 kill |
|||
iptables -L INPUT --line-numbers -v
iptables -A INPUT -s 58.245.23.126/24 -j DROP
iptables -D INPUT 3
pre-up iptables-restore < firewall.txt Making changes persistent in CentOS 5iptables rules are stored in memory. |
|||
Make sure userid’s and groupid’s match between the systems
Set up the server
|
|||
The most minimal way of doing an installation is using sassc, the C binding. apt install git build-essential cd /opt git clone https://github.com/sass/libsass.git git clone https://github.com/sass/sassc.git libsass/sassc echo 'SASS_LIBSASS_PATH="/opt/libsass"' >> /etc/environment source /etc/environment echo $SASS_LIBSASS_PATH # Make sure it worked… cd libsass/sassc make ln -sn /opt/libsass/sassc/bin/sassc /usr/local/bin/ sassc file.scss file.css # run like this |
|||
By default Ubuntu 16.04 (Xenial) now comes with php 7.0 You can install php 5.6 in parallel and switch between them using the following instructions: add-apt-repository ppa:ondrej/php apt update apt install php5.6 libapache2-mod-php5.6 php5.6-curl php5.6-gd php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml php5.6-xmlrpc a2dismod php7.0 a2enmod php5.6 systemctl restart apache2
|
|||
Resources
|
|||
To install: sudo apt-get install cups-pdf There are a couple of pitfalls:
|
|||
See ubuntuforums.org/…owthread.php and bbs.archlinux.org/…ewtopic.php for explanations |
|||
