Skip to content

Instantly share code, notes, and snippets.

View xiongchiamiov's full-sized avatar

James Pearson Hughes xiongchiamiov

View GitHub Profile
#!/usr/bin/env python
import requests
from constants import *
auth = requests.auth.HTTPBasicAuth(client_id, client_secret)
data = {
'grant_type': 'password',
'username': username,
Process: clementine [19189]
Path: /Applications/clementine.app/Contents/MacOS/clementine
Identifier: org.clementine-player.clementine
Version: 1.2.3-1280-g10860b7 (4096.1.2.3.2.1280)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: clementine [19189]
User ID: 501
Date/Time: 2015-08-04 13:24:02.003 -0700
The Holy Church of Good Design Sense
====================================
Motivation
----------
Once, we were all lost. We used fancy javascripts from DynamicDrive because we thought they were cool, thought bigger was better, and knew nothing about Section 508. Then, we were found, and have lived our lives in enlightenment ever after.
There are many who have not yet made this journey. Our goal is to gently guide them into full awareness, thus working toward world peace.
// ==UserScript==
// @name Remote Random Gmail Signature for Firefox 3
// @version .61beta
// @namespace http://gmail.com
// @description Add random signature to Gmail
// @include http://mail.google.com/*
// @include https://mail.google.com/*
// @include http://gmail.google.com/*
// @include https://gmail.google.com/*
// @author ravard@gmail.com

Improving Security for Bugzilla

Frequently asked questions

What happened?

Bugzilla restricts access to security-sensitive information so that only certain privileged users can access it. An attacker was able to break into a privileged user’s account and download security-sensitive information about flaws in Firefox and other Mozilla products.

How did the attacker gain access?

@xiongchiamiov
xiongchiamiov / gmail more evident star
Created September 8, 2010 21:56
A Stylish script to make Gmail's star more evident.
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("mail.google.com") {
.adG { background-image: url("http://imgur.com/IhdX5.png") !important; }
}
@xiongchiamiov
xiongchiamiov / gist:744705
Created December 17, 2010 09:28
Pinboard.in bookmarklet for accessing bookmarks
// Assuming a keyword of 'pin',
// 'pin' will retrieve all bookmarks
// 'pin linux' will retrieve all bookmarks tagged 'linux'
// 'pin linux tools' will retrieve all bookmarks tagged both 'linux' and 'tools'
javascript:params='%s';url='http://pinboard.in/u:xiong.chiamiov';if(params!=''){tags=params.split('%20');for(i=0;i<tags.length;i++){url+='/t:'+tags[i];}}location.href=url;
@xiongchiamiov
xiongchiamiov / quality
Created January 20, 2011 08:44
determine quality of mp3 files
#!/usr/bin/env ruby
require 'shellwords'
ARGV.each do |file|
info = %x{mediainfo #{Shellwords.escape(file)}}.split("\n")
if !info.grep(/Variable/).empty?
bitrate = info.grep(/-V (\d+)/){$1}[0]
puts "#{file}: Variable bitrate v#{bitrate}"
elsif !info.grep(/Constant/).empty?
@xiongchiamiov
xiongchiamiov / shell.py
Created July 11, 2011 22:15
Run `command` through the shell and return a tuple of the return code and the output.
from subprocess import PIPE, Popen, STDOUT
class ShellError(Exception):
def __init__(self, command, returnCode, output):
self.command = command
self.returnCode = returnCode
self.output = output
def __str__(self):
return '''Command '%s' exited with non-zero exit code %s.
mysql> drop tables states;
ERROR 1051 (42S02): Unknown table 'states'
mysql> create table states(i int) engine=innodb;
ERROR 1005 (HY000): Can't create table 'cart.states' (errno: -1)
110803 16:44:41 InnoDB: Error creating file './cart/states.ibd'.
110803 16:44:41 InnoDB: Operating system error number 17 in a file operation.
InnoDB: Error number 17 means 'File exists'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/operating-system-error-codes.html