This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getCss( elem ){ | |
var rules = [].slice.call(window.getMatchedCSSRules( elem )); | |
return rules.map( rule => rule.style.cssText ).join(''); | |
} | |
function addInlineCss( elem, isRecurssive ){ | |
elem.setAttribute( 'style', getCss( elem ) ); | |
if( isRecurssive && elem.children.length ){ | |
[].slice.call( elem.children ).forEach( v => addInlineCss(v, true ) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Plane vimrmc file without any extra plugins. Useful for use in server env | |
" This file is inspired by spf13's vimrc | |
" https://gist.github.com/harish2704/7cbc767a61110fd8bbbd05d50a71ebe1 | |
" My custom commands {{{ | |
" Grep for a word | |
command! -nargs=1 Gr :execute 'grep -nr <f-args> ./ <CR>' | |
" Add file header to current buffer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file-roller --extract-here * | |
for i in $(ls -d */); do | |
extId=$( cat $i/metadata.json | grep uuid | sed 's/.*"uuid".*"\(.*\)".*/\1/' ); | |
mv $i $extId; | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Usage: rpm-mk-build-deps.sh <path_to_spec_file> | |
# | |
mkBuildDeps(){ | |
specFile=$1 | |
pkgName=$(rpmspec -q $specFile --qf '%{name}') | |
pkgVersion=$(rpmspec -q $specFile --qf '%{version}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE USER 'hari'@'%' IDENTIFIED VIA mysql_native_password USING '***'; | |
--- GRANT USAGE ON *.* TO 'hari'@'%' REQUIRE NONE WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0; | |
GRANT USAGE ON *.* TO 'hari'@'%' ; | |
CREATE DATABASE IF NOT EXISTS `hari`; | |
GRANT ALL PRIVILEGES ON `hari`.* TO 'hari'@'%'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
__author__ = 'xanter' | |
#from datetime import datetime | |
import signal | |
import time | |
import dbus | |
import gobject | |
import urllib2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Usage: run-parallel.sh <URL-list> <proxy-list> <parallel-job-count> <cmd> | |
# Environment variables | |
# - SKIP_PROXY_VALIDATION - if set, skip proxy list validation step. | |
# - OUTPUT - default value is 'tmux' which will send each jobs to tmux session. for any string, output of each jobs will be saved inside directory tree with given name | |
urlListRaw=$1 | |
proxyListRaw=$2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node -e "console.log( JSON.stringify( JSON.parse(require('fs').readFileSync(0) ), null, 1 ))" | |
# Exapmle usage | |
# echo unformated.json | node -e "console.log( JSON.stringify( JSON.parse(require('fs').readFileSync(0) ), null, 1 ))" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
listProcessNameMib=.1.3.6.1.2.1.25.4.2.1.2 | |
listProcessArgsMib=.1.3.6.1.2.1.25.4.2.1.5 | |
snmpHost=$1 | |
snmpCommunity=$2 | |
shift | |
shift | |
processName=$@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set menu_color_normal=white/black | |
set menu_color_highlight=black/light-gray | |
menuentry "Try openSUSE Tumbleweed GNOME Live ISO" { | |
set gfxpayload=keep | |
set iso_path=/openSUSE-Tumbleweed-GNOME-Live-x86_64-Snapshot20180220-Media.iso | |
loopback loop0 ${iso_path} | |
echo Loading kernel... |