Skip to content

Instantly share code, notes, and snippets.

View letnando's full-sized avatar
🔒
Locked

Fernando letnando

🔒
Locked
  • Andromeda
View GitHub Profile
0463939bd9686f9e6799830de5c2c53e2551c016fe4d7e71e9064d9cb7a9660d8c786beadf46f0946c83aa692a2b060c7e0df7704f721229152b04b29192e07b4f
sudo swapoff -a;
sudo rm -Rf /swapfile;
sudo fallocate -l 1G /swapfile;
sudo chmod 600 /swapfile;
sudo mkswap /swapfile;
sudo swapon /swapfile;
#!/bin/bash
sudo fallocate -l 1G /swapfile;
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;
sudo sysctl vm.swappiness=10;
@letnando
letnando / hb_all_books_dl.js
Created November 29, 2017 17:49 — forked from kfatehi/hb_all_books_dl.js
Humble bundle book bundles - download all books at once
/*
After purchasing a humble book bundle, go to your download page for that bundle.
Open a console window for the page and paste in the below javascript
this fork downloads all formats and does so without using jquery (since that didnt work for me)
note that if you are in chrome, chrome will not download the pdfs for you by default, to fix this
type “about:plugins” in the address bar and disable chrome's pdf viewer
*/
var pattern = /(MOBI|EPUB|PDF)$/i;
@letnando
letnando / test
Created October 9, 2017 22:14
test
0xe6f4e35268c595ba51ea1fdf7402b88d0eb2b069
@letnando
letnando / bash-cheatsheet.sh
Created February 14, 2017 15:14 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@letnando
letnando / gist:50154dff6046a5ed421c
Last active August 29, 2015 14:16
My Mint Customize Script
#!/bin/bash
# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
echo "You're running $(cat /etc/issue)"
add-apt-repository -y ppa:noobslab/icons # For faenza
add-apt-repository -y ppa:peterlevi/ppa # For variety
add-apt-repository ppa:kilian/f.lux # For f.lux (redshift)
@letnando
letnando / gist:4646e9d7e4733d2baa96
Created January 2, 2015 16:48
Basic daemon on Linux
DAEMON="/usr/bin/php"
DAEMON_OPTS="/var/www/myproject/myscript.php"
START_OPTS="--start --background --make-pidfile --pidfile ${PIDFILE} --exec ${DAEMON} ${DAEMON_OPTS}"
STOP_OPTS="--stop --pidfile ${PIDFILE}"
test -x $DAEMON || exit 0
set -e