Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/sh
filename=file.ogv
inputDir=~/Desktop/
output=~/Desktop/${filename}.mp4
input=${inputDir}/${filename}
mencoder $input -of lavf -lavfopts format=mp4 -oac mp3lame -lameopts cbr:br=128 -ovc x264 -x264encopts bitrate=1000 -o $output
@getkub
getkub / TemplateGenerator.py
Created April 24, 2015 11:52
Pystache (Mustache) based variable replacement
import shutil
import time
import os, sys, argparse
import fnmatch
import pystache
import json
localtime = time.localtime()
timeString = time.strftime("%Y%m%d%H%M%S", localtime)
@getkub
getkub / configTemplator
Last active December 24, 2017 17:21
pystache (mustache) based template example
{
"hostname": "myhostName",
"IPaddr": "128.129.289.0"
}
====================
import pystache
import json
renderer = pystache.Renderer()
@getkub
getkub / siteminderJquery
Last active August 29, 2015 14:16
Extract information from headers
// load and initialise first
$.getScript("../header.js", function() {
//main();
json = $.parseJSON(getCookie('myHeader'));
userId = json.UserLogin;
userName = json.FullName.replace(/^.*,\s+/,"") + " " + json.FullName.replace(/,.*/,"");
if ( window.location.pathname == "/myModule/abc.html" ) {
$(".container h2").text("123 Role");
pageRole="123";
@getkub
getkub / gist:e935e50ef01edb735138
Created February 25, 2015 11:35
jquery Loading Ajax
$(document).on({
ajaxStart: function() { $body.addClass("loading"); },
ajaxStop: function() { $body.removeClass("loading"); }
});
@getkub
getkub / createUser.sh
Last active August 29, 2015 14:14
Create or Modify User in AIX, Solaris, Linux Systems
# AIX
newUser="newXYZ"
extraGroupsToAdd="secondGroup,thirdGroup" # comma separated
gecosVal="SYS/someDetails.POC/newUser"
UID=215 # Put uid based on your system
mkuser id=${UID} pgrp=staff groups=staff,${extraGroupsToAdd} gecos="${gecosVal}" ${newUser}
# chgrpmem -m + ${newUser} <group> # adds a user to a group , or the - for removal
chuser maxage=0 ${newUser}
ldapsearch -h yourserver.com -p 389 -b 'DC=dc,DC=com,DC=mycompany' -D "CN=userid,OU=org_unit,DC=dc,DC=com,DC=mycompany" -w 'xyz!' '(objectclass=*)' '*' | grep ^dn: | more
@getkub
getkub / plunkerEmbed
Created November 21, 2014 15:28
Embedding plunker Code
<iframe style="border: 1px solid #999;width: 100%; height: 300px"
src="http://embed.plnkr.co/xlGFOu2WfRGL1zJOtlu9" frameborder="0"
allowfullscreen="allowfullscreen">
Loading plunk...
</iframe>
@getkub
getkub / List_WebDevelopment_stuff
Last active August 29, 2015 14:09
List of Good Webdevelopment modules
# Web Developers cannot live without "bootstrap", "JQuery"
# But on top of this there are some very good modules
################################################################################
################################################################################
################# T H E M E S #################
################################################################################
# Themes for Bootstrap
http://bootswatch.com
@getkub
getkub / MSPowershellCommands
Last active October 23, 2015 13:25
Microsoft Commands - Powershell
# Various Move/Copy commands with pipe operators
http://technet.microsoft.com/en-us/library/hh849852.aspx
#Move files
gci -af -rec | move-item -destination C:\Data\xyz\destinationDir
# find alternative
netstat -aon | select-string ":8089" | select-string "LISTENING"
# wmic