Setup scrot on Ubuntu

Simple trick to setup simple command to spawn screenshot utility using scrot: $ sudo apt-get install scrot $ sudo touch /usr/bin/sel $ sudo chmod +x /usr/bin/sel $ vim /usr/bin/sel #!/bin/bash scrot -s -e ‘mv $f ~/Pictures/’

Install pulse secure linux 9 on Fedora 28

This installation is using pulse secure linux version 9 with rpm package ps-pulse-linux-9.0r1.0-b739-centos-rhel-64-bit-installer.rpm $ sudo dnf install compat-libicu57-57.1-2.fc28.x86_64 $ sudo dnf install libgnome-keyring $ sudo rpm -i ps-pulse-linux-9.0r1.0-b739-centos-rhel-64-bit-installer.rpm Create vpn shortcut (optional): $ sudo touch /usr/bin/vpn $ sudo vim /usr/bin/vpn Fill with this script below: #!/bin/bash export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/pulse /usr/local/pulse/pulseUi Make it executable: $ sudo chmod … Read more

Generate CSR for Nginx server

This is how to generate the .csr file, requirement for SSL certificate. $ openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr —– Country Name (2 letter code) [AU]:ID State or Province Name (full name) [Some-State]: Locality Name (eg, city) []: Organization Name (eg, company) [Internet Widgits Pty Ltd]: Organizational Unit Name (eg, section) … Read more

Start forticlient VPN only with command line

If your VPN client office using forticlient, you might want to run your VPN client with only command line, so you don’t have to see the small window just for connect your servers from home. With this bash script you can run your forclient VPN client only with CLI. Install expect first if you’re using … Read more

Bash script to run terraform recursively

#!/bin/bash cd prd && ls -d */ declare -a dirs i=1 for d in */ do dirs[i++]=”${d%/}” done echo “There are ${#dirs[@]} dirs in the current path” for((i=1;i<=${#dirs[@]};i++)) do cd “${dirs[i]}” && rm -rf .terraform \ && echo “terraform {” > \ && echo “backend \”consul\” {” >> \ && echo “}” >> … Read more

Setup SSH key passphrase only ask once

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