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 | |
# by TB : 2012-10-12 | |
if [ "$USER" != "root" ] | |
then | |
echo "You must be root to execute this script (in order to instruct the kernel to drop the cache)!" | |
exit 1 | |
fi | |
if [ -z "$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 | |
# Tooltip fix | |
# A script to fix themes files in Ubuntu 11.10 | |
# to have readable tooltips in applications such | |
# as eclipse. | |
# The script edits the gtk.css, settings.ini and gtkrc files | |
# Author: Victor Pillac | |
# http://victorpillac.wordpress.com | |
if [ $EUID -ne 0 ]; then |
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 | |
# Print the serial number of your disks with this script | |
ls /dev/disk/by-id/ata* | awk -F- '{ if (NF==4) { print $NF} }' | while read SERIAL; | |
do | |
DEVICE=$(readlink -f /dev/disk/by-id/*$SERIAL); | |
echo $DEVICE" "$SERIAL; | |
done | sort; |
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 -e | |
# Little program that measure the speed in MBps of a file transfer occuring in the current directory | |
LASTTIME=$(date +%s) | |
LASTSIZE=$(du -bs . 2> /dev/null | awk '{ print $1 }') | |
TOTALSIZE=0 | |
TOTALTIME=0 | |
while true |
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 -e | |
# USAGE : | |
# $0 IP NAME DOMAIN | |
if [ "$#" != "3" ] | |
then | |
echo "Usage:" | |
echo $0 IP HOSTNAME DOMAIN |
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
/************************************************************************ | |
Copyright 2013 Tony Bussieres | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
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 io.netty.buffer.ByteBuf; | |
import io.netty.channel.ChannelHandlerContext; | |
import io.netty.handler.stream.ChunkedInput; | |
import io.netty.util.CharsetUtil; | |
public abstract class ChunkedBuffer implements ChunkedInput<ByteBuf> { | |
int offset = -1; | |
boolean closed = false; | |
protected byte[] buffer = null; |
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
//... | |
final int port=8888; | |
ServerBootstrap b = new ServerBootstrap(); | |
//... | |
b.bind(port).addListener(new ChannelFutureListener() { | |
@Override | |
public void operationComplete(ChannelFuture future) throws Exception { | |
if (!future.isSuccess()) { | |
if (future.cause() instanceof BindException) { |
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 | |
# credits goes to http://silviumc.wordpress.com/2011/12/05/how-to-stop-the-screen-saver-in-kde-while-watching-long-flash-clips-in-a-web-browser/ | |
while /bin/true | |
do | |
qdbus org.freedesktop.ScreenSaver /ScreenSaver SimulateUserActivity > /dev/null; | |
sleep 1m; | |
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 | |
WAV="$1" | |
if [ -z "$WAV" ]; then | |
echo "Usage: $0 OUTPUT.WAV" >&2 | |
exit 1 | |
fi | |
rm -f "$WAV" | |
# Get sink monitor: | |
MONITOR=$(pactl list | egrep -A2 '^(\*\*\* )?Source #' | \ |
OlderNewer