Skip to content

Instantly share code, notes, and snippets.

View nehaljwani's full-sized avatar

Nehal J Wani nehaljwani

View GitHub Profile
Typically used irssi config
### Large portions shamelessly copied from https://wiki.archlinux.org/index.php/Irssi (Thank you Arch Wiki )
# Please refer to the aforementioned link for more detail and customization.
# irssi has a pretty good default config that you don't usually want to mess with much
# A couple of basic things that are needed are specified here. Type /set to see a complete list of modifiable parameters.
# BASIC SETUP:
diff --git a/daemon/remote.c b/daemon/remote.c
index 47267c2..4f186b3 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -2220,6 +2220,129 @@ no_memory:
}
static int
+remoteSerializeDomainInterfacePtr(virDomainInterfacePtr ifaces,
+ unsigned int ifaces_count,
#!/bin/sh
#+Author: Nehal J Wani
#To Convert logformat squid %tl %6tr %>a %Ss/%03>Hs %<st %rm %ru %un %Sh/%<A %mt to Default
cat $1 | awk -v FS='/' '{ printf "06/%s/",$1; printf "%.4s %s\n",$3, substr($3,6,9)}' > STAMP
cat STAMP | uniq -c | awk '{{ print $1 > "COUNT"} {print $2,$3 > "STAMP_1"}}'
rm -f STAMP
while read line ; do echo `date -d "$line" "+%s"`".000" ; done < STAMP_1 > TIMESTAMP
rm -f STAMP_1
Just for quick reference
-------------------------------------------------------------------------
USEFUL ONE-LINE SCRIPTS FOR SED (Unix stream editor) Dec. 29, 2005
Compiled by Eric Pement - pemente[at]northpark[dot]edu version 5.5
Latest version of this file (in English) is usually at:
http://sed.sourceforge.net/sed1line.txt
http://www.pement.org/sed/sed1line.txt
This file will also available in other languages:
Just for quick reference
HANDY ONE-LINE SCRIPTS FOR AWK 30 April 2008
Compiled by Eric Pement - eric [at] pement.org version 0.27
Latest version of this file (in English) is usually at:
http://www.pement.org/awk/awk1line.txt
This file will also be available in other languages:
Chinese - http://ximix.org/translation/awk1line_zh-CN.txt
#!/bin/sh
#+Author: Nehal J Wani
#CONVERT SQUID ACCESS.LOG TO HUMAN READABLE
cat $1 | awk '{print $1}' | sort | uniq -c > STAMP
cat STAMP | awk '{print $1}' > COUNT
cat STAMP | awk '{print $2}' > STAMP_1
rm -f STAMP
while read line ; do echo `date -d @"$line"` ; done < STAMP_1 > TIMESTAMP
rm -f STAMP_1
#!/usr/bin/env python
import poplib
import sys
lenArgs = len(sys.argv)
if lenArgs != 5:
print "\n\tDelete all messages from <startMsg> to <endMsg> on Students server\n"
print "\tUsage:./script <username>[without @students.iiit.ac.in] <password> <startMsg> <endMsg>\n"
sys.exit(0)
server = "students.iiit.ac.in"
port = 995
daemon/remote.c | 73 +++++++++++++++++
include/libvirt/libvirt.h.in | 23 ++++++
python/generator.py | 1 +
python/libvirt-override-api.xml | 6 ++
src/driver.h | 6 ++
src/libvirt.c | 52 ++++++++++++
src/libvirt_public.syms | 1 +
src/qemu/qemu_agent.c | 175 ++++++++++++++++++++++++++++++++++++++++
src/qemu/qemu_agent.h | 3 +
src/qemu/qemu_driver.c | 64 +++++++++++++++
@nehaljwani
nehaljwani / gist:6124816
Created July 31, 2013 18:36
TCP and UDP Listening On Same Port
udp_server.py
import socket
UDP_IP = "10.1.39.241"
UDP_PORT = 6005
sock = socket.socket(socket.AF_INET, # Internet
socket.SOCK_DGRAM) # UDP
sock.bind((UDP_IP, UDP_PORT))
#!/bin/sh
#
# fedora-fromiso - Patch the ramdisk of Fedora to allow booting from
# ISO image
#
# Copyright (C) 2012 Mansour <mansour@oxplot.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are