Skip to content

Instantly share code, notes, and snippets.

View rabin-io's full-sized avatar

Rabin Yasharzadehe rabin-io

View GitHub Profile
@rabin-io
rabin-io / pre-compress-web-assets
Last active November 15, 2019 19:24
Recursively pre-compress (gzip) CSS/JavaScript/webfont assets for use Nginx and the HttpGzipStaticModule module.
#!/bin/bash
###########################################################################
# Usage:
# pre-compress-web-assets [.|folder_name]
#
# This script will recursively look for the files in the $ext variable
# and compress/re-compress them.
#
# By default it will look into the current working folder,
@rabin-io
rabin-io / bucklespring.spec
Last active May 29, 2021 23:40
bucklespring.spec
Name: bucklespring
Version: 1.5.0
Release: 1%{?dist}
Summary: Nostalgia bucklespring keyboard sound
Group: Applications/Multimedia
License: GPLv2
URL: https://github.com/zevv/bucklespring
#Source0: https://github.com/rabin-io/bucklespring/archive/v%{version}.tar.gz
@rabin-io
rabin-io / virt-delete
Last active April 18, 2018 16:24 — forked from larsks/virt-delete
A shell script for deleting a libvirt domain and associated storage
#!/bin/sh
echo "Destroy: $1"
virsh destroy $1 2> /dev/null
for disk in $(virsh -q domblklist $1 | awk '{print $2}'); do
pool=$(virsh vol-pool $disk)
name=$(virsh vol-info $disk | awk '$1 == "Name:" {print $2}')
echo "Delete volume: $disk ($name in $pool)"
@rabin-io
rabin-io / gitkraken-install-update.sh
Last active April 16, 2019 18:28 — forked from seangtkelley/gitkraken-install.sh
Install Script for Gitkraken on Fedora 27 + Launcher Icon
#!/bin/bash
if [[ ${UID} -ne 0 ]];
then
echo 'This script need to be run with root permissions'
echo "(we assume you don't have write access to /opt)"
exit
fi
<?php
/***********************************************************************************
*
* A minimal example showing how to handle the OAuth login process and make API calls
* using the Salesforce REST interface in PHP
*
* By Pete Warden, October 28th 2010
*
* Freely reusable with no restrictions
@rabin-io
rabin-io / 88-MASTER-DISPATCHER
Last active October 23, 2018 20:08
88-MASTER-DISPATCHER
#!/bin/bash
[[ -z ${CONNECTION_UUID} ]] && exit 0
DEVICE=${1}
STATE=${2}
CWD=$(dirname "$0")
LOG='/var/log/NetworkManager_dispatcher.d.log'
@rabin-io
rabin-io / tcset.py
Created January 2, 2020 21:19
WIP: Ansible tc Module (Utilizes tcconfig on the client machine)
#!/usr/bin/python
# Copyright: (c) 2018, Terry Jones <[email protected]>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# from lib.ansible.modules.system.iptables import push_arguments
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
# Taken from http://www.boi.org.il/he/Markets/Pages/explainxml.aspx
# the Key in hash is used in our table, and the value is for BOI
$currency_code = @{ "$" = "01"; "לש" = "02"; "Eur" = "27"; }
$API_URL = 'https://www.boi.org.il/currency.xml?'
$rdate = [DateTime]::Now
$script:recursive_limit = 7
$SQLServer = "localhost"
$DB_USER = "scripts_user"
$DB_PASS = "p@$$w0rd"
<?php
$dbh = new PDO(
'mysql:host=127.0.0.1:3066;dbname=cacti',
'cacti',
'password',
);
$paletteName = "50 Steps of Flame";
$gradient = array("FF0000","FF0300","FF0600","FF0900","FF0C00","FF1000","FF1300",
// ==UserScript==
// @name Toggle line wrap in Gmail
// @namespace https://rabin.io/
// @version 0.3
// @description Press "w" (hotkey) to toggle linewrap for emails
// @author rabin.io
// @license GPLv3
// @downloadURL https://gist.githubusercontent.com/rabin-io/f81e4267485c79708e38d3216d335cdc/raw/gmail-toggle-wrap.user.js
// @homepageURL https://blog.rabin.io/quick-tip/add-a-custom-hotkey-in-gmail-with-greasemonkey-tampermonkey
// @match https://mail.google.com/mail/u/*