This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ ! $1 ]] | |
then echo "Usage: $0 <mac address>" | |
exit 1 | |
else | |
mac=$1 | |
#echo ${mac:0:8} | |
oui=${mac:0:8} | |
grep -i $oui /usr/share/wireshark/manuf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BaSH color examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zenity example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# filekeeper.py | |
import os, sys, hashlib, fnmatch | |
# TODO | |
# os.link(source, link_name) | |
# set to false for quieter output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ifping.sh | |
# f varas 10 2012 | |
## | |
## you need to have sshpass or ssh-key | |
## to grant "passwordless" access to the servers | |
# execute an action when remote server replies to ping | |
counter=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# nyan.sh | |
NYAN="~=[,,_¸¸]:3" | |
length=0 | |
for length in {1..100}; do | |
clear | |
printf -v line '%*s' "$length" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# df.py | |
# inispirational code taken from: | |
# https://gist.github.com/1569253 | |
from __future__ import with_statement | |
import contextlib | |
import os | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# launcher.sh | |
while true; do if [[ ! $(ps -ef |egrep "python.*[m]ain") ]] ; then echo "server down"; ./main.py; fi; sleep 10; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# script to change the volume using amixer + zenity | |
current_vol=$(amixer -c 0 get 'Master' |tail -1| sed 's/.*\[\([0-9][0-9]\%\)\].*/\1/g'| sed 's/%//g') | |
function volume { | |
VOLVALUE=$(zenity --scale --value=$current_vol --text "set volume") | |
CMD="amixer -c 0 set 'Master' $VOLVALUE%" | |
echo $CMD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
error_reporting(0); | |
$data = file('failIP.text'); | |
foreach ($data as $line) { | |
$host = trim($line); | |
$country = geoip_country_name_by_name($host); | |
if ($country) { | |
echo 'Host '.$host. ' is located in: '.$country. "\n"; |
OlderNewer