Skip to content

Instantly share code, notes, and snippets.

View alseambusher's full-sized avatar
:shipit:
...

Suresh Alse alseambusher

:shipit:
...
View GitHub Profile
@alseambusher
alseambusher / minimize.sh
Created December 29, 2012 18:25
Code to minimize all the windows in Linux
#!/bin/bash
new_window_id=`xprop -root | grep '_NET_ACTIVE_WINDOW(WINDOW)'| cut -d '#' -f 2`
old_window_id=""
close_wait=0
while [ $close_wait -le 10 ]
do
if [ "$old_window_id" = "$new_window_id" ]
then
close_wait=$(($close_wait+1))
else
@alseambusher
alseambusher / config.php
Last active December 10, 2015 08:38
phpMyAdmin Config
<?
/* FIND THESE LINES AND CHANGE THEM IN YOUR CONFIG FILE
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
@alseambusher
alseambusher / diskpart
Created January 1, 2013 18:37
DISKPART Recovery
DISKPART
LIST DISK
SELECT DISK 1
CLEAN
CREATE PARTITION PRIMARY
SELECT PARTITION 1
ACTIVE
FORMAT FS=NTFS
ASSIGN
EXIT
@alseambusher
alseambusher / myapp.desktop
Created January 4, 2013 10:09
To show your application in 'open with' in ubuntu 12.04, make a file called APPLICATION_NAME.desktop in /usr/share/applications and provide necessary commands in it. Here is an example of an application called 'myapp' (say in /usr/bin/myapp ). Say your application is used to view jpeg images (for mimetype). Say your icon exists as /usr/share/ico…
[Desktop Entry]
Name=My App
GenericName=My App
Comment=No comment
Exec=/usr/bin/myapp %U
Terminal=false
Type=Application
StartupNotify=true
MimeType=image/jpeg
Icon=myapp
@alseambusher
alseambusher / bashrc
Created February 27, 2013 02:41
Make STAR WARS come when you open the terminal
function print_element {
while [ $cols -ge 1 ]
do
printf "$element"
cols=`expr $cols - 1`
done
}
function print_sentence {
cols=`tput cols`
size=`expr "$sentence" : '.*'`
@alseambusher
alseambusher / open_with_script.sh
Last active December 15, 2015 19:19
open_with_script.sh
#!/bin/bash
echo -n "Enter Application name:"
read Name
if [ "$Name" = "" ]
then
echo "ERROR: Application name can't be empty"
exit 1
fi
echo -n "Comment about Application:"
read Comment
@alseambusher
alseambusher / script.sh
Last active December 22, 2015 13:58
log manager for Game of thrones
#!/bin/bash
# log is 1:2
echo -n "how many episodes u wanna see: "
read count
while [ $count -ne 0 ]
do
log=`cat log`
expr "$log" : "\(.*\):.*"
series=`expr "$log" : "\(.*\):.*"`
episode=`expr "$log" : ".*:\(.*\)"`
@alseambusher
alseambusher / bufferoverflow.c
Created September 20, 2013 00:18
simple buffer overflow in c
#include<stdio.h>
void bad_func(){
printf("Hacked!!!\n");
}
int main(int argc,char** argv){
char buffer[100];
strcpy(buffer,argv[1]);
return 0;
}
@alseambusher
alseambusher / crypt-editor.sh
Last active August 29, 2015 13:57
crypt-editor uses mcrypt to encrypt and decrypt text enabling
#!/bin/bash
usage()
{
cat <<EOF
Usage $0:
crypt-editor -help
crypt-editor [filename]
crypt-editor [editor] [filename]
crypt-editor [-k key] [filename]
crypt-editor [-k key] [editor] [filename]
#!/bin/bash
while getopts "de:" OPTION
do
case $OPTION in
d)
# mailexe -d [original] [duplicate]
#decoding
base64 $2 > original
base64 $3 > duplicate