Skip to content

Instantly share code, notes, and snippets.

@dbalan
dbalan / lastfm_to_gmusic.py
Created July 13, 2016 20:19 — forked from Timmmm/lastfm_to_gmusic.py
Convert Last.fm loved tracks to your Google Play Store Music Play All Access Subscription Service by Google™. It creates a new playlist rather than adding the tracks to your library willy-nilly. See code for more details.
#!/usr/bin/env python
# Lastfm loved tracks to Google Music All Access playlist.
#
# Written by Tim Hutt, tdhutt@gmail.com, based on this script:
#
# https://gist.github.com/oquno/3664731
#
# Today is the 15th of September 2013.
#
(setq el-get-sources
'((:name package-name)))
(defun sync-packages ()
"Synchronize packages"
(interactive)
(el-get 'sync '(el-get package))
(add-to-list 'package-archives '("tromey" . "http://tromey.com/elpa/"))
(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/"))
(setq my-packages (mapcar 'el-get-source-name el-get-sources))
"""
This file contains code that, when run on Python 2.7.5 or earlier, creates
a string that should not exist: u'\Udeadbeef'. That's a single "character"
that's illegal in Python because it's outside the valid Unicode range.
It then uses it to crash various things in the Python standard library and
corrupt a database.
On Python 3... well, this file is full of syntax errors on Python 3. But
if you were to change the print statements and byte literals and stuff:
@dbalan
dbalan / iptables
Created November 20, 2013 09:23 — forked from UtahDave/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
@dbalan
dbalan / stuns
Created November 8, 2013 07:18 — forked from zziuni/stuns
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net
@dbalan
dbalan / gist:7338912
Created November 6, 2013 16:10 — forked from pch/gist:1322006

How to use Spotify in any country

If you can put up with ads, you can easily trick Spotify and sign up for an account, even if you're not in one of the supported countries. You'll need:

  • A Facebook account
  • SSH access to a server based in one of the supported countries (US, UK, whatevs).

First, set up an SSH tunnel, as described here: http://paulstamatiou.com/how-to-surf-securely-with-ssh-tunnel

@dbalan
dbalan / app.py
Created September 10, 2013 15:57 — forked from mattupstate/app.py
os
from flask_extended import Flask
app = Flask(__name__)
app.config.from_yaml(os.join(app.root_path, 'config.yml'))
package main
import (
"fmt"
"http"
"io/ioutil"
"os"
)
func main() {
diff rtems-20100326/chains.py /tmp/rtems-20100326/chains.py
17,19c17
< if not self.node_val:
< return True
< return False
---
> return self.node_val['next'] == 0
23c21
< self.node_val = self.node_val['next']
---