Skip to content

Instantly share code, notes, and snippets.

ksaitor / objectInArray
Created September 17, 2012 21:43
find object in array function
function has(arr, obj){
for (var i = 0; i < arr.length; i++) {
if (arr[i] == obj) return true;
ksaitor /
Created November 2, 2012 15:20 — forked from mnem/
Prettifies bash terminals with git
# Setup the prompt so that it shows the current branch when in a git directory.
source /usr/local/etc/bash_completion.d/git-completion.bash
source /usr/local/etc/bash_completion.d/
function setup_prompts_for_git
local BLUE="\[\e[0;34m\]"
local RED="\[\e[0;31m\]"
local YELLOW="\[\e[0;33m\]"
local PURPLE="\[\e[0;35m\]"
local CLR_RESET="\[\e[0m\]"
ksaitor / gist:5726034
Last active May 13, 2019 17:51
fatal: CRLF would be replaced by LF
perl -pi -e 's/\r\n/\n/g' input.file
"color_scheme": "Packages/Obsidian Color Scheme/Obsidian.tmTheme",
"default_line_ending": "unix",
"fade_fold_buttons": true,
"font_size": 13.0,
"highlight_line": true,
"find_selected_text": true,
"match_brackets_angle": true,
"ensure_newline_at_eof_on_save": true,
Tricks to add encrypted private SSH key to .travis.yml file
To encrypt the private SSH key into the "-secure: xxxxx....." lines to place in the .travis.yml file, generate a deploy key then run: (to see what the encrypted data looks like, see an example here:
base64 --wrap=0 ~/.ssh/id_rsa > ~/.ssh/id_rsa_base64
ENCRYPTION_FILTER="echo \$(echo \"-\")\$(travis encrypt veewee-community/veewee-push \"\$FILE='\`cat $FILE\`'\" | grep secure:)"
split --bytes=100 --numeric-suffixes --suffix-length=2 --filter="$ENCRYPTION_FILTER" ~/.ssh/id_rsa_base64 id_rsa_
alias kb="knife bootstrap"
# alias k="knife bootstrap windows ssh FQDN
# alias k="knife bootstrap windows winrm FQDN
alias kbdc="knife client bulk delete"
alias kcc="knife client create --editor /usr/bin/sublime"
alias kdc="knife client delete"
alias kec="knife client edit"
ksaitor /
Created April 19, 2014 17:38
during my unix class i developed this script. now i thought it might be useful to someone, and decided to post it here. it might need some additional editing to match ur system. enjoy
#User Information gathering script developed by Raman Ksaitor ( raman.ksaitor at
#The script is designed primaraly for system administrators (and other root privelaged). The purpose is to gather most of system user information and save it in privatized files. Emphases is also put on easy and quick access to scripts parameters (by elemenating "choose forms", useless decorations, and by allowing pass parameters with a command line all-at-once).
#Script allows to deal with one single user (example with user "root": $ ./ -u root -niShfbsoH) or with a list of users (example with list of users "userlist": $ ./ -l "userlist -niShfbsoH")
#informational options:
# -n displays network and general information about user(s). Includes full login name, short name, home directory, shell, wether user is currently online or not, online idle time, current ip adress, first and last known login date, total online time.
# herein we backup our indexes! this script should run at like 6pm or something, after logstash
# rotates to a new ES index and theres no new data coming in to the old one. we grab metadatas,
# compress the data files, create a restore script, and push it all up to S3.
TODAY=`date +"%Y.%m.%d"`
INDEXNAME="logstash-$TODAY" # this had better match the index name in ES
BACKUPCMD="/usr/local/backupTools/s3cmd --config=/usr/local/backupTools/s3cfg put"
YEARMONTH=`date +"%Y-%m"`

Keybase proof

I hereby claim:

  • I am ksaitor on github.
  • I am ksaitor ( on keybase.
  • I have a public key whose fingerprint is 8F4E AC75 C6DD F07D DD6E 2E54 E1D0 83B0 87CD 00B1

To claim this, I am signing this object:

ksaitor / ethereum-payment-metamask.html
Last active March 13, 2024 04:28
How to add Ethereum payments to your site with MetaMask
<!DOCTYPE html>
<script src=""></script>
<button class="pay-button">Pay</button>
<div id="status"></div>