Skip to content

Instantly share code, notes, and snippets.

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: https://github.com/veewee-community/veewee-push/blob/486102e6f508214b04414074c921475e5943f682/.travis.yml#L21
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_
# BOOTSTRAP COMMANDS
alias kb="knife bootstrap"
# alias k="knife bootstrap windows ssh FQDN
# alias k="knife bootstrap windows winrm FQDN
# CLIENT COMMANDS
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
ksaitor / user_data.sh
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
#!/bin/sh
# DESCRIPTION
#User Information gathering script developed by Raman Ksaitor ( raman.ksaitor at gmail.com)
#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).
#
# FUNCTIONALITY
#Script allows to deal with one single user (example with user "root": $ ./ui.sh -u root -niShfbsoH) or with a list of users (example with list of users "userlist": $ ./ui.sh -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.
#!/bin/bash
# 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
INDEXDIR="/usr/local/elasticsearch/data/logstash/nodes/0/indices/"
BACKUPCMD="/usr/local/backupTools/s3cmd --config=/usr/local/backupTools/s3cfg put"
BACKUPDIR="/mnt/es-backups/"
YEARMONTH=`date +"%Y-%m"`
@ksaitor
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
ksaitor / pretty_git_bash.sh
Created November 2, 2012 15:20 — forked from mnem/pretty_git_bash.sh
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/git-prompt.sh
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\]"
{
"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,
"ignored_packages":

Keybase proof

I hereby claim:

  • I am ksaitor on github.
  • I am ksaitor (https://keybase.io/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
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
@ksaitor
ksaitor / ethereum-payment-metamask.html
Last active March 13, 2024 04:28
How to add Ethereum payments to your site with MetaMask
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
<div>
<button class="pay-button">Pay</button>
<div id="status"></div>
</div>