What kind of laptop are we using?
Sometimes you want to know the serial of your laptop that you’re using on ubuntu, use this command: sudo dmidecode | grep -A 9 “System Information” Or sudo dmidecode -s system-product-name
Sometimes you want to know the serial of your laptop that you’re using on ubuntu, use this command: sudo dmidecode | grep -A 9 “System Information” Or sudo dmidecode -s system-product-name
This is how I install python 2.7.13 without erasing the current version of python that exists inside the OS. It is an alternative install. $ wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tar.xz $ tar xvf Python-2.7.13.tar.xz $ cd Python-2.7.13 $ ./configure $ make $ sudo make altinstall
Sometimes it’s annoying when you’re trying to work with your project and whenever you need to enter your key passphrase. So I wanna make this passphrase prompt ask only once. vim ~/.bash_profile and put this at the bottom of the file : eval $(ssh-agent) ssh-add Or if you don’t want to be asked for passphrase … Read more
This is how to install traceroute in ubuntu machine apt-get install traceroute And how to use it : $ traceroute google.com traceroute to google.com (74.125.68.100), 30 hops max, 60 byte packets 1 192.168.100.1 (192.168.100.1) 2.281 ms 2.378 ms 2.398 ms 2 61.5.80.1 (61.5.80.1) 9.254 ms 9.357 ms 9.378 ms 3 121.subnet125-160-11.speedy.telkom.net.id (125.160.11.121) 8.980 ms 8.966 … Read more
I use vagrant for daily development, now vagrant has this directory mounted when we setup vagrant at the first time. But sometimes I’d like to mount my own directory to my local machine. This is the way I create samba share in my vagrant : apt-get install samba samba-common Create user for project useradd -m user1 … Read more
If you looking for some text in files in some directory, this command should do the trick grep -rnw ‘/path/to/somewhere/’ -e “pattern”
When you work with vagrant, you might want your project folder to be mounted on some directory on your local. You can do that easily with file manager, but here’s my favorite way to mount my samba share in vagrant to my directory on my local. So I can work on that. Before you do … Read more
To edit cronjob: $ crontab -e cronjob cheat: Do the job every 5 menit */5 * * * * do.sh
Simple tunneling with ssh with port forwarded to connect your service locally. Make sure your local port is available first. $ ssh -f user@website.com -L 2000:website.com:5432 -N
This example using Centos with nginx on it $ wget https://dl.eff.org/certbot-auto $ chmod a+x certbot-auto $ sudo ./certbot-auto –authenticator webroot –installer nginx