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/sh | |
pactl list sinks | grep --color=never -E '(^Sink|Name|device.description)' | sed 's/^Sink #//g' | sed -r 's/Name: //g' | sed -r '/[[:digit:]]$/{N;s/\n//}' | sed -r '/_sink$/{N;s/\n//}' | sed 's/\t\tdevice.description = /\t/g' |
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 | |
# Example: increae brightness by 15% | |
# backlight.sh inc 15 | |
CURRENT_BRIGHTNESS=$(cat /sys/class/backlight/intel_backlight/brightness) | |
MAX_BRIGHTNESS=$(cat /sys/class/backlight/intel_backlight/max_brightness) | |
ONE_PERCENT_FACTOR=$(( MAX_BRIGHTNESS / 100 )) |
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/sh | |
for IP in $(nmap -n -sL 10.8.9.10-50 | awk '{print $5}' | grep --color=never '^[0-9]'); do | |
echo $IP | |
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/sh | |
cgcreate -a $USER -s 666 -g swap,memory:chrome | |
cgset -r memory.limit_in_bytes=4G -r memory.soft_limit_in_bytes=3800M -r memory.swappiness=5 chrome | |
cgexec -g memory:chrome /opt/google/chrome/google-chrome |
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
import akka.http.scaladsl.model.HttpHeader | |
import akka.http.scaladsl.model.HttpMethods._ | |
import akka.http.scaladsl.model.HttpResponse | |
import akka.http.scaladsl.model.headers.`Access-Control-Allow-Credentials` | |
import akka.http.scaladsl.model.headers.`Access-Control-Allow-Methods` | |
import akka.http.scaladsl.model.headers.`Access-Control-Allow-Origin` | |
import akka.http.scaladsl.model.headers.Origin | |
import akka.http.scaladsl.server.Directive0 | |
import akka.http.scaladsl.server.Directives._ | |
import akka.http.scaladsl.server.MethodRejection |
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
# YOUR LOCAL BOX | |
socat -t0 -T0 tcp4-listen:6667,reuseaddr,fork UDP:localhost:4445 | |
ssh user@remote_server -R 6667:localhost:6667 | |
# REMOTE MACHINE | |
socat -t0 -T0 udp4-recvfrom:4445,reuseaddr,fork tcp:localhost:6667 |
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
<?xml version="1.0" encoding="UTF-8" ?> | |
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> | |
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="true"> | |
<plugin name="UDPReceiver" class="org.apache.log4j.net.UDPReceiver"> | |
<param name="Port" value="4445" /> | |
</plugin> | |
<logger name="org.apache.log4j"> | |
<level value="warn"/> | |
</logger> | |
<root> |
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 | |
# created by Josh Frye | joshfng@gmail.com | |
# Check if the user has sudo privileges. | |
sudo -v >/dev/null 2>&1 || { echo $(whoami) has no sudo privileges ; exit 1; } | |
# Update the system before going any further | |
echo "Updating system..." | |
sudo apt-get update >> install.log && sudo apt-get -y upgrade >> ~/install.log | |
echo "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/sh | |
LB_HEALTH=$(elb-describe-instance-health 'my-elb-name') | |
echo "$LB_HEALTH" | |
LB_NAME=$(echo "$LB_HEALTH" | awk 'BEGIN { ORS=" " } { print $2 }') | |
echo "$LB_NAME" | |
INST_CMD=$(echo "$LB_NAME" | awk '{ print "ec2-describe-instances " $0 }') | |
echo "$INST_CMD" | |
INST_HEALTH=$(eval "$INST_CMD") | |
echo "$INST_HEALTH" |
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
curl http://github.com/api/v2/json/blob/all/ganglia/gmond_python_modules/master |
NewerOlder