Skip to content

Instantly share code, notes, and snippets.

View Temikus's full-sized avatar

Artem Yakimenko Temikus

View GitHub Profile
@Temikus
Temikus / index.html
Created August 20, 2012 19:48
Webkit sample for tinkering
<!-- WEBKIT SAMPLE -->
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<style type="text/css">
#box div
{
position: absolute;
@Temikus
Temikus / comparator.sh
Created October 21, 2012 14:25
Simple comparator script for UNIX-like systems. i.e. works on FreeBSD and Mac.
#!/bin/bash
#Parses 1st and 2nd argument as directory paths and compares MD5 sums recursively
#Usage: ./comparator.sh /mount/directory /other_mount/directory
find "$1" -type f | while read filename; do
name="${filename#$1*}"
sum1="$(md5 -q "$1$name")"
sum2="$(md5 -q "$2$name")"
@Temikus
Temikus / launchd_example.plist
Created October 27, 2012 18:55
Generic plist for launchd
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<false/>
<key>Label</key>
<string>com.username.somethingsomething</string>
<key>ProgramArguments</key>
<array>
@Temikus
Temikus / gist:4072762
Created November 14, 2012 15:27
Print out everything between 2 patterns of text.
sed -n '/pattern1/,/pattern2/p'
@Temikus
Temikus / vmware.repo
Last active October 13, 2015 05:58
VMware tools repo file for RHEL/CentOS6.
[vmware-tools]
name=VMware Tools for Red Hat Enterprise Linux $releasever - $basearch
baseurl=http://packages.vmware.com/tools/esx/latest/rhel6/$basearch
enabled=1
gpgcheck=1
gpgkey=http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub
#Provides:
#vmware-tools-esx
#vmware-tools-esx-nox
@Temikus
Temikus / unix_aliases.bat
Created December 7, 2012 07:32
UNIX-like aliases for Windows CLI tools.
::grep
echo findstr %1 %2 %3 %4 %5 > %systemroot%\grep.cmd
::ifconfig
echo IF "%1"=="-a" (ipconfig /all) ELSE (ipconfig %1) > %systemroot%\ifconfig.cmd
::man
echo %1 /?> %systemroot%\man.cmd
::ls
echo IF "%1"=="-a" (dir) ELSE (IF "%1"=="-al" (dir) ELSE (dir %1 %2 %3 %4 %5)) > %systemroot%\ls.cmd
@Temikus
Temikus / backup.sh
Created December 19, 2012 17:10 — forked from anonymous/backup.sh
#!/bin/bash
# incrementally backup $HOME using rsync
SOURCE="$HOME/"
DEST="/media/Dragis_HDD/homebackup/"
KEEP=5 # how many backups besides the current one should be kept
EXCLUDEFROM="$SOURCE/.backup_excludes"
NICENESS=10
LOGFILE="$DEST/.lastbackup.log"
# NOTE: some of these will be 404s (30th of February, days with no comics, etc.)
# 404s can be removed with `find . -type f -size -1000c -iname "*.gif" -exec rm {} \;`
from urllib import urlretrieve
for y in range(2000, 2013):
for m in range(1, 13):
print "starting", y, m
@Temikus
Temikus / vpnroute.sh
Created January 2, 2013 19:42
A nice way to make sure that specific application uses only a specific tunnel interface.
#!/bin/bash
groupadd vpnroute
iptables -A OUTPUT -m owner --gid-owner vpnroute \! -o tun0 -j REJECT
sudo -g vpnroute some-app &
@Temikus
Temikus / add_drive.bat
Created January 6, 2013 16:22
A set of bat files for testing drive/folder association. 1) Add a virtual drive with letter T. 2) Clean up the association record. 3) Delete the virtual drive.
@echo Creating a test empty folder...
mkdir C:\TempDriveT
subst T: C:\TempDriveT