Skip to content

Instantly share code, notes, and snippets.

View francisregan's full-sized avatar

Francis Regan francisregan

View GitHub Profile
@francisregan
francisregan / gist:3d897e913cb12a41514030c5afacb570
Created March 6, 2017 10:29
Auto start a script in linux
Create an upstart
Create file /etc/init/myjob.conf
vi /etc/init/myjob.conf
with content like the following
description "my job"
start on startup
@francisregan
francisregan / curl-http-get-post.sh
Created April 24, 2016 16:16
Make http get and post calls using curl.
# HTTP POST
response=$(curl -s -H "Content-Type: application/json" -X POST -d '{MESSAGE_inJSON}' http://POST URL
echo $response
# HTTP GET
response=$(curl -s http://GET URL)
echo $response
@francisregan
francisregan / disable-ipv6.sh
Last active September 20, 2020 09:13
Disable IPV6 on ubuntu via grub and sysctl.conf
echo "--------------Disabling IPv6-------------------------"
echo 'net.ipv6.conf.all.disable_ipv6 = 1' >> /etc/sysctl.conf
echo 'net.ipv6.conf.default.disable_ipv6' >> /etc/sysctl.conf
echo 'net.ipv6.conf.lo.disable_ipv6 ' >> /etc/sysctl.conf
echo 'net.ipv6.conf.wlp3s0.disable_ipv6 ' >> /etc/sysctl.conf
sed -i -e 's/quiet splash/quiet splash ipv6.disable=1/g' /etc/default/grub
update-grub2
@francisregan
francisregan / jdk-installer.sh
Created April 20, 2016 15:48
Install JDK in ubuntu using bash script
#!/bin/bash
if [[ $# -eq 0]] ; then
echo "No argument supplied. Type sudo bash installjava.sh jdk1.8.0_74"
exit 1
fi
if [ "$(whoami)" != "root" ]; then
echo "Sorry, please run as root. Type sudo bash installjava.sh jdk1.8.0_74"
exit 1
fi