Skip to content

Instantly share code, notes, and snippets.

@keheliya
keheliya / gist:21fab7f2f754b3cb06c7fcc8a21eaaf4
Created June 4, 2019 23:27
Automatically start tmux on SSH session
if [[ -z "$TMUX" ]] && [ "$SSH_CONNECTION" != "" ]; then
tmux attach-session -t ssh_tmux || tmux new-session -s ssh_tmux
fi
@keheliya
keheliya / scottknotESD.r
Created January 26, 2018 00:25
Creating box plots grouped by Scottknot ranks
library(ggplot2)
library(reshape)
if(!require(svglite)){install.packages("svglite")}
if(!require(plyr)){install.packages("plyr")}
if(!require(ScottKnottESD)){install.packages("ScottKnottESD")}
library(ScottKnottESD)
library (plyr)
keywords <- as.character(c("creation","processing","reporting","other"))
travis_configs <- read.table("../linecounts.csv", header=F,
@keheliya
keheliya / i3weather.sh
Last active July 16, 2021 23:28
I recently started using i3wm because it is light-weight, keyboard-friendly and uses the screen real-estate efficiently. I customized i3bar and i3status (which came installed with i3) to show system information and date/time. But there was no out-of-the-box feature to get weather information from i3 status. I wanted a simple solution that does n…
#!/bin/sh
# shell script to prepend i3status with weather
i3status | (read line && echo "$line" && read line && echo "$line" && read line && echo "$line" && while :
do
read line
temp=$(cat ~/.weather.cache | grep -m 1 -Eo -e '-?[[:digit:]].*°C')
status=$(cat ~/.weather.cache | head -n 3 | tail -n 1 | cut -c 16-)
echo ",[{\"full_text\":\"${temp}  ${status}\",\"color\":\"#00FF00\" },${line#,\[}" || exit 1
done)
This file has been truncated, but you can view the full file.
;(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
//
// The shims in this file are not fully implemented shims for the ES5
// features, but do work for the particular usecases there is in
// the other modules.
//
var toString = Object.prototype.toString;

Keybase proof

I hereby claim:

  • I am keheliya on github.
  • I am keheliya (https://keybase.io/keheliya) on keybase.
  • I have a public key ASA0r5kfp_R_5XKmo_h-gT9pa1dRZ_PXuPs-xFM-lddfMQo

To claim this, I am signing this object:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://wso2.org/bps/sample">
<soapenv:Header/>
<soapenv:Body>
<sam:CorrTestRequest>
<sam:input>${#TestCase#inputValue}</sam:input>
</sam:CorrTestRequest>
</soapenv:Body>
</soapenv:Envelope>
def myTestCase = context.testCase
def x = (Math.random()).toString()
myTestCase.setPropertyValue("inputValue", x)
inputValue = context.expand( '${#TestCase#inputValue}' )
log.info inputValue
#!/bin/bash
for f in *.avi
do
echo "converting file - $f"
ffmpeg -i "$f" "${f%.*}.mov"
echo "created file ${f%.*}.mov"
done
#!/bin/bash
for f in *.avi
do
echo "converting file - $f"
arista-transcode -p ipad -d apple "$f"
echo "created file ${f%.*}.m4v"
done
@keheliya
keheliya / audio_strip.sh
Created April 21, 2013 13:36
How to remove audio streams from AVI/MKV files "So I have this AVI file with 2 audio tracks, the first and default track is in French, the second one is in English. How do I go about deleting the French audio track and making the English track the default audio?"
#!/bin/bash
for f in *.avi
do
echo "converting file - $f"
mkvmerge -o "${f%.*}_conv.avi" --atracks 2 "$f"
echo "created file ${f%.*}_conv.avi"
done