Copy pulseaudio configuration template to home folder.
cp /etc/pulse/default.pa ~/.pulse/default.pa
Append
ignore_dB=1
to line withload-module module-udev-detect
.Make sure "speaker" volume is at 100% using alsamixer (press F6 and select HDA NVidia to see more volume controls.
To make "speaker" volume persist between boots, run
alsactl store -f ~/.asoundrc
then makealsactl restore -f ~/.asoundrc
start when logging into your user. (See `Arch Wiki - ALSA`_)
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
temp_image = Image.open("picture.png") | |
raw_image = temp_image.tostring() | |
image = pyglet.image.ImageData(width, height, 'RGB', raw_image, pitch= -resized_x * 3) |
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 pyglet | |
from pyglet.gl import * | |
window = pyglet.window.Window() | |
image = pyglet.image.load('circle.png') | |
mask = pyglet.image.load('mask.png') | |
texture = pyglet.image.Texture.create(200, 200) | |
done = False |
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 | |
# Install wmctrl before using: sudo apt-get install wmctrl | |
# From http://ubuntuforums.org/showthread.php?p=11761683 | |
# User settings | |
sleep 8 # Time it takes before script starts with autodetection | |
DELAY="2" # Set delay | |
# End of user settings |
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 | |
# 1. Install nautilus-actions and create a new action | |
# 2. Under "Command" tab: "Path" -> "create-launcher.sh" and "Parameters" -> "%f" | |
# 3. Copy create-launcher.sh to somewhere in $PATH and make executable | |
# For some reason the desktop gets sent to nautilus actions as "/", so just make launcher go to desktop | |
# if the current user doesn't own the location sent to the script. | |
if [ -O $1 ]; then | |
PATHNAME=$1 |
Add the following to /etc/hdparm.conf
:
apm_battery = 128
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 re | |
REMOVE_PATTERN = re.compile(r'\n\s*\{') | |
def compact(django_temp): | |
with open(django_temp) as f: | |
text = f.read() | |
compacted = re.sub(REMOVE_PATTERN, r'{', text) | |
return compacted | |
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/python | |
#usage python ppastats.py PPATEAM (ex: webupd8team) PPA (ex: gthumb) DIST (Ubuntu version eg maverick) ARCH (ubuntu arch eg i386 or amd64) | |
#http://www.webupd8.org/2010/12/launchpad-finally-gets-ppa-usage-stats.html | |
#example - highest downloaded file: python ppastats.py webupd8team y-ppa-manager maverick amd64 | tr '\t' ',' | cut -d ',' -f3 | sort -gr | |
import sys | |
from launchpadlib.launchpad import Launchpad | |
PPAOWNER = sys.argv[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
package main | |
/* | |
http://play.golang.org/p/3YP3gdwpFG | |
*/ | |
import "fmt" | |
func main() { | |
s := "This is a string." |
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
package main | |
import "fmt" | |
import "bytes" | |
import "io" | |
var msg = []byte("Hello World this is James") | |
func main() { | |
cipherText := bytes.NewBuffer(make([]byte, 0, len(msg)+16)) |