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
# @author: Ashish Gawikwad <ash.gkwd@gmail.com> | |
# @license: MIT License | |
# @script: It contains all the functions and aliases which | |
# are frequently used by author. | |
# | |
sleepToRAM () { | |
dbus-send --system --print-reply \ | |
--dest="org.freedesktop.UPower" \ | |
/org/freedesktop/UPower \ |
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
powerCycleUSB_3 () { | |
for i in $(ls /sys/bus/pci/drivers/xhci_hcd/|grep :) | |
do echo $i >/sys/bus/pci/drivers/xhci_hcd/unbind | |
echo $i >/sys/bus/pci/drivers/xhci_hcd/bind | |
done | |
} | |
powerCycleUSB_2 () { | |
for i in $(ls /sys/bus/pci/drivers/ehci_hcd/|grep :) | |
do echo $i >/sys/bus/pci/drivers/ehci_hcd/unbind |
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
""" | |
Author: Ashish Gaikwad <ash.gkwd@gmail.com> | |
Description: This script will post a message on your slack channel | |
Please configure your `/etc/slack_post.cfg` file first. | |
Example slack_post.cfg | |
[slack] | |
url=https://hooks.slack.com/services/XxXxXxXxXx | |
channel=botwa |
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
var db = new PouchDB('ar-db'); | |
var leads = [{ | |
_id: 'a'+Date.now(), | |
name: "Murali Prasad Sharma", | |
contact: [{ | |
handle: "9867327500", | |
channel: "Mobile" | |
}, { | |
handle: "ash.gkwd@gmail.com", | |
channel: "Email" |
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 onOpen() { | |
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); | |
var menu = []; | |
menu.push({name: "Get Results", functionName: "logData_"}); | |
spreadsheet.addMenu("Super Awesome Menu", menu); | |
} | |
function logData_() { | |
Logger.log("This is my log, it's awesome :)"); | |
var dest = copySheet_(); |
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
[core] | |
editor = vi | |
[alias] | |
spull = !git-svn fetch && git-svn rebase | |
spush = !git-svn dcommit | |
send = !git spull && git spush | |
up = pull --rebase | |
on = push origin master | |
co = checkout |
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
import hashlib | |
passwd = "mywalletpassword" | |
salt = "summersaltstringwhichislong" | |
p = 1 | |
r = 8 | |
n = 262144 | |
dklen = 32 | |
dec_key = hashlib.scrypt(bytes(passwd, 'utf-8'), salt=bytes.fromhex(salt), n=n, r=r, p=p, maxmem=2000000000, dklen=dklen) | |
print(dec_key) |
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 your app name - the Chromium Browser (i.e Chrome, Brave) in a variable. | |
appName="Brave" | |
# Get the bundle Id of the Chromium Browser, store it in a variable. | |
bundleID=$(osascript -e 'id of app "'$appName'"') | |
# Example: Get the bundle Id of Brave browser | |
# Returns: | |
# com.brave.Browser |
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
DOMAIN_NAME="my.web.site"; | |
PROJECT_ID="my-gcp-project-id"; | |
# create bucket of domain name | |
gsutil mb -p $PROJECT_ID -b on gs://$DOMAIN_NAME | |
# set index file | |
gsutil web set -m index.html gs://$DOMAIN_NAME | |
# set error file |
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
export function Cable() { | |
function _initSocket({ | |
url = "ws://localhost:4080/cable", // Take from config | |
onOpen, | |
onClose, | |
onError, | |
onMessage, | |
}) { | |
Cable.socket = new WebSocket(url); | |
Cable.socket.onopen = onOpen; |
OlderNewer