Skip to content

Instantly share code, notes, and snippets.

View FeroVolar's full-sized avatar
✌️

Fero Volar FeroVolar

✌️
View GitHub Profile
@FeroVolar
FeroVolar / profile
Created September 14, 2018 11:02
Bash /etc/profile for macOS 10.13.x
# System-wide .profile for sh(1)
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
@FeroVolar
FeroVolar / github_contributors.sh
Created February 12, 2016 07:18
Github Get the Contributor List of a Repository
curl -s https://api.github.com/repos/ceph/ceph-ansible/stats/contributors | grep login | awk -F ":" '{print $2}' | sed 's/"/,@/;s/,$//;s/"$//' | tr -d '\n'
,@bmanojlovic ,@hunter ,@guits ,@lorin ,@marmot21 ,@mcsage ,@byronmccollum ,@maethor ,@mhubig ,@laboshinl ,@fcharlier ,@bstillwell ,@lyandrew ,@jjoos ,@BjoernT ,@psy-q ,@bsanders ,@pb-it ,@eikef ,@lpabon ,@ti-mo ,@alfredodeza ,@aisrael ,@andymcc ,@Abhishekvrshny ,@gpocentek ,@Logan2211 ,@git-harry ,@darkcrux ,@nexecook ,@rootfs ,@crcceph ,@mattt416 ,@bengland2 ,@bjne ,@HanXHX ,@andrewschoen ,@matthewrees ,@xals ,@jcftang ,@flisky ,@guestisp ,@msambol ,@leseb
@FeroVolar
FeroVolar / raspbian_clean.sh
Last active October 7, 2015 22:24
Remove garbage from Raspbian
#!/bin/bash
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v "deinstall" | grep x11 | sed s/install//`
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v "deinstall" | grep python | sed s/install//`
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v "deinstall" | grep sound | sed s/install//`
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v "deinstall" | grep gnome | sed s/install//`
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v "deinstall" | grep lxde | sed s/install//`
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v "deinstall" | grep gtk | sed s/install//`
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v "deinstall" | grep desktop | sed s/install//`
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v "deinstall" | grep gstreamer | sed s/install//`
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v "deinstall" | grep avahi | sed s/install//`
@FeroVolar
FeroVolar / mandrillmail.php
Last active August 29, 2015 14:26
SENDING EMAIL WITH MANDRILL
<?php
function send_email($to_email,$subject,$message1)
{
require_once 'Mandrill.php';
$apikey = 'XXXXXXXXXX'; //specify your api key here
$mandrill = new Mandrill($apikey);
$message = new stdClass();
$message->html = $message1;
$message->text = $message1;
@FeroVolar
FeroVolar / sms.php
Last active August 29, 2015 14:26
Sending SMS
<?php
function send_sms($mobile,$msg)
{
$authKey = "XXXXXXXXXXX";
date_default_timezone_set("Asia/Kolkata");
$date = strftime("%Y-%m-%d %H:%M:%S");
//Multiple mobiles numbers separated by comma
$mobileNumber = $mobile;
//Sender ID,While using route4 sender id should be 6 characters long.
@FeroVolar
FeroVolar / remote.sh
Last active August 29, 2015 14:16
Remote shell commands execution
## ssh remoteserver.com 'bash -s' < commands.sh
#
## commands.sh example
sudo su
cd /web/remoteserver.com/
git remote update
LOCAL=$(git rev-parse @)
REMOTE=$(git rev-parse @{u})
@FeroVolar
FeroVolar / twofinger.sh
Created March 12, 2014 14:21
How to enable Two finger scrolling on Lenovo
#!/bin/bash
xinput --set-prop --type=int --format=32 "SynPS/2 Synaptics TouchPad" "Synaptics Two-Finger Pressure" 4
xinput --set-prop --type=int --format=32 "SynPS/2 Synaptics TouchPad" "Synaptics Two-Finger Width" 8
xinput --set-prop --type=int --format=8 "SynPS/2 Synaptics TouchPad" "Synaptics Two-Finger Scrolling" 1 0
@FeroVolar
FeroVolar / permissions.sh
Last active January 2, 2016 14:19
Learn octal file permissions easily with stat
$ stat -c "%a %A %n" /usr/sbin/* | head
755 -rwxr-xr-x /usr/sbin/aa-status
777 lrwxrwxrwx /usr/sbin/accept
755 -rwxr-xr-x /usr/sbin/accessdb
755 -rwxr-xr-x /usr/sbin/acpid
777 lrwxrwxrwx /usr/sbin/addgroup
755 -rwxr-xr-x /usr/sbin/add-shell
755 -rwxr-xr-x /usr/sbin/adduser
755 -rwxr-xr-x /usr/sbin/anacron
755 -rwxr-xr-x /usr/sbin/apachetop
@FeroVolar
FeroVolar / banner.sh
Last active January 2, 2016 08:18
shell banner
banner -w25 "Hello, World"
@FeroVolar
FeroVolar / redmine
Created December 11, 2013 14:32
Redmine init.d script for Debian
#!/bin/bash
### BEGIN INIT INFO
# Provides: redmine
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redmine webrick
# Description: redmine webrick server autostart-script
### END INIT INFO