Free up disk space on linux with bleachbit
[raw]
wget https://download.bleachbit.org/bleachbit_2.2_all_ubuntu1804.deb
sudo apt-get install python-gtk2 -y
apt –fix-broken install
apt-get install python-gtk2 -y
dpkg -i bleachbit_2.2_all_ubuntu1804.deb
bleachbit –list | grep -E “[a-z0-9_\-]+\.[a-z0-9_\-]+” | xargs bleachbit –clean
[/raw]
Create a ssh key with a simple one liner.
HOSTNAME=`hostname` ssh-keygen -t rsa -C "$HOSTNAME" -f "$HOME/.ssh/id_rsa" -P "" && cat ~/.ssh/id_rsa.pub
The easy way to unmount sshfs goes as follows
sudo umount -l directory
Use -l “lazy” which is required for unmounting sshfs
-l, --lazy detach the filesystem now, clean up things later
Speed up rsync over lan or wan with this simple addition to your command.
-e "ssh -T -c aes128-ctr -o Compression=no -x"
Her we use the new command in a safe (dry run) example
rsync -avn --progress -e "ssh -T -c aes128-ctr -o Compression=no -x" source/ user@x.x.x.x:/destination
Disable all Docker containers auto restart
docker update --restart=no $(docker ps -q)
It is easy to use Python with forever.js:
[raw]
forever start -c python python_script.py
[/raw]
To use it with virtualenv is a little bit more complicated, I did it using a bash script (call it python_virtualenv):
[raw]
#!/bin/bash
# Script to run a Python file using the local virtualenv
source bin/activate
bin/python $@
[/raw]
Now use that script with forever:
[raw]
forever start -c ./python_virtualenv python_script.py
[/raw]
Easy one liner to install nodejs and forever on Ubuntu 18.04
[raw]
apt-get install -y nodejs-dev npm ; npm install forever -g
[/raw]
Custom build of Docker WordPress 4.9.8-php7.1-apache with mcrypt, redis, memcached, and imagemagick libraries ready to go!
Available at 88plug/wordpress now on Docker hub!
[raw]
xscreensaver -no-splash
[/raw]
Add the above command to your startup applications.
[raw]
mkdir -p /etc/run/systemd/resolve
ln -sr /etc/run/systemd/resolve/resolv.conf /etc/run/systemd/resolve/stub-resolv.conf
[/raw]
Now add a nameserver to stub-resolv.conf
[raw]
nameserver 1.1.1.1
nameserver 1.0.0.1
[/raw]
[raw]
RUN apt-get update -y
RUN apt-get install -y libgmp-dev re2c libmhash-dev libmcrypt-dev file
RUN ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/local/include/
RUN docker-php-ext-configure gmp
RUN docker-php-ext-install gmp
RUN docker-php-ext-configure mcrypt
RUN docker-php-ext-install mcrypt
RUN echo extension=gmp.so > $PHP_INI_DIR/conf.d/gmp.ini
RUN echo extension=mcrypt.so > $PHP_INI_DIR/conf.d/mcrypt.ini
[/raw]
[raw]
dconf write /org/gnome/desktop/interface/cursor-size 48
[/raw]
Fix fatal error: curl/curl.h: No such file or directory
[raw]
apt-get install libcurl4-openssl-dev
[/raw]
or
[raw]
apt-get install libcurl4-gnutls-dev
[/raw]
Fix fatal error: gmp.h: No such file or directory
[raw]
apt-get install libgmp3-dev
[/raw]
Fix fatal error: mysql.h: No such file or directory
[raw]
apt-get install libmysqlclient-dev
[/raw]
[raw]sudo apt-add-repository -y ppa:teejee2008/ppa ; apt-get update ; sudo apt-get install -y ukuu ; sudo ukuu –check ; sudo ukuu –install-latest –yes[/raw]
Reboot!
Get the location of any server from the command line geolocate bash
[raw]
curl ipinfo.io/X.X.X.X
[/raw]
This is the easiest way to check if the last command was succesful in bash.
[raw]
your_command_to_test
if [ $? -eq 0 ]; then
echo OK
else
echo FAIL
fi
[/raw]
Install CUDA 9.0 on Ubuntu 16.04 using apt-get – easiest method
First install and switch default gcc to gcc 7.1
[raw]
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test && sudo apt-get update && sudo apt-get install -y g++-7 gcc-7 && \
sudo update-alternatives –install /usr/bin/gcc gcc /usr/bin/gcc-7 60 –slave /usr/bin/g++ g++ /usr/bin/g++-7 && \
sudo update-alternatives –config gcc
[/raw]
Now setup
[raw]
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_9.1.85-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1604_9.1.85-1_amd64.deb
sudo apt-get update
sudo apt-get install -y cuda-9-1
[/raw]
Reboot!
Easily enable swap on Ubuntu 16.04 with this easy to use one-liner.
sudo fallocate -l 16G /swapfile #If fallocate is not available, use #dd if=/dev/zero of=/swapfile1 bs=1024 count=137438883103 #For 128gb sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab echo 'vm.swappiness = 10' | sudo tee -a /etc/sysctl.conf echo 'vm.vfs_cache_pressure=50' | sudo tee -a /etc/sysctl.conf echo "Swap enabled"