Skip to content

Instantly share code, notes, and snippets.

@sweemeng
sweemeng / ircbot.py
Created February 26, 2014 13:46
Beginning of a IRC bot
#!/usr/bin/python
import socket
HOST="irc.freenode.net"
PORT=6667
BOTNAME="sweemengs_bot"
CHANNEL="#myoss"
class Bot(object):
@DomT4
DomT4 / kextexclusionlist.xml
Last active August 29, 2015 14:07
Kext Signing Exception List OS X 10.10
This file has been truncated, but you can view the full file.
// Apple moved the file, again. It's now in /System/Library/Extensions/AppleKextExcludeList.kext/Contents/Info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>OSKextExcludeList</key>
<dict>
<key>at.obdev.nke.LittleSnitch</key>
<string>LE 4041</string>
anonymous
anonymous / default.diff
Created October 18, 2013 19:51
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..f818674
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,3 @@
+include *
+recursive-include * *
+prune .git
\ No newline at end of file
@hanxue
hanxue / chrome-canvas-convert-to-webp.js
Created October 11, 2017 14:05
Chrome canvas convert image to webp
/*
* This file is a part of the Save Image As WebP project.
* Minimized by GCC.
*/
function openTabsAfterInstall() {
var domA = "chrome.google.com/webstore/detail/adaibkfbghiebecgfclpgpkgkmigmbmn";
chrome.tabs.create({
url: "https://" + domA,
selected: false,
pinned: false
@tony4d
tony4d / mysqldump-backup.sh
Last active June 11, 2019 03:28
Backup all databases on a mysql server excluding information/performance_schema and including UDFs/stored procedures. Most useful scheduling this on a slave db.
#!/bin/bash
# No username or passwords in this script, you should use mysql_config_editor
# to store it securely. The login-path in this script is set to "local-backup" so when you create
# your .mylogin.cnf with the mysql-config-editor make sure it is set the same
# See http://dev.mysql.com/doc/refman/5.6/en/mysql-config-editor.html
# An example to create your config for a mysql user "backup":
# shell> sudo mysql_config_editor set --login-path=local-backup --host=localhost --user=backup --password
# The backup user in the mysql server needs these privileges: SELECT, RELOAD, SHOW DATABASES, REPLICATION CLIENT
@recolic
recolic / go-get-for-china.py
Last active August 9, 2019 03:01
go-get golang.org/x/... will run perfectly!
#!/bin/env python3
# by Recolic Keghart, Nov 16
import sys
import os
import subprocess
if len(sys.argv) < 2:
print('Error: go-get-for-china <pkg path>')
exit(1)
@dbarnett
dbarnett / jsonalchemy.py
Created February 3, 2012 15:10
JSONAlchemy: Proper JSON marshalling and mutation tracking in SQLAlchemy
import simplejson
import sqlalchemy
from sqlalchemy import String
from sqlalchemy.ext.mutable import Mutable
class JSONEncodedObj(sqlalchemy.types.TypeDecorator):
"""Represents an immutable structure as a json-encoded string."""
impl = String
@jarek-przygodzki
jarek-przygodzki / centos-install-kernel-debuginfo.sh
Created February 16, 2017 20:23
CentOS 7 - How to install kernel-debuginfo
yum --enablerepo=base-debuginfo install -y kernel-debuginfo-$(uname -r)

Build your own private, encrypted, open-source Dropbox-esque sync folder

Prerequisites:

  • One or more clients running a UNIX-like OS. Examples are given for Ubuntu 12.04 LTS, although all software components are available for other platforms as well (e.g. OS X). YMMV
  • A cheap Ubuntu 12.04 VPS with storage. I recommend Backupsy, they offer 250GB storage for $5/month. Ask Google for coupon codes.

Software components used:

  • Unison for file synchronization
  • EncFS for folder encryption
@hanxue
hanxue / embed-gist-in-blogger.js
Created January 18, 2014 10:48
Embed Gists in Blogger
At the end of your Blogger post , using HTML editor, append this
<script src="https://raw.github.com/moski/gist-Blogger/master/public/gistLoader.js" type="text/javascript"></script>
In the content of your blog post, simply add this:
<div class="gistLoad" data-id="8488564" id="gist-8488564">Loading https://gist.github.com/8488564....</div>
Note: adding the URL is useful because when the javascript does not work, readers can copy and paste the URL themselves.