This file contains hidden or 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 ( | |
"crypto/tls" | |
"io/ioutil" | |
"log" | |
"net/http" | |
) | |
func main() { |
This file contains hidden or 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 os | |
import shutil | |
from glob import glob | |
import subprocess | |
output_path = 'mp3' | |
mp3_quality = '320k' | |
if os.path.exists(output_path): | |
shutil.rmtree(output_path) |
This file contains hidden or 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
from django.http import HttpResponseRedirect | |
from django.conf import settings | |
class LoginRequiredMiddleware: | |
def process_request(self, request): | |
if not request.user.is_authenticated(): | |
path = request.path_info | |
if not path.startswith('/accounts/'): | |
return HttpResponseRedirect(settings.LOGIN_URL) |
This file contains hidden or 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
// sudo apt-get install libfuse-dev pkg-config | |
// gcc -Wall deny.c `pkg-config fuse --cflags --libs` -o deny | |
// mkdir foo | |
// ./deny foo | |
#define FUSE_USE_VERSION 26 | |
#include <fuse.h> | |
#include <stdio.h> | |
#include <string.h> |
This file contains hidden or 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
wget https://github.com/vslavik/poedit/releases/download/v1.7.5-oss/poedit-1.7.5.tar.gz | |
tar xf poedit-1.7.5.tar.gz | |
cd poedit-1.7.5 | |
apt-get install -y build-essential libwxgtk3.0-dev libicu-dev libgtkspell-dev libdb5.3++-dev liblucene++-dev libboost1.54-dev libboost-regex1.54-dev libboost-system1.54-dev | |
sed -i 's/Version: 3.0.3.4/Version: 3.0.5/' /usr/lib/x86_64-linux-gnu/pkgconfig/liblucene++.pc | |
./configure | |
make | |
make install |
This file contains hidden or 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
mkdir -p /tmp/ffmpeg_sources | |
cd /tmp/ffmpeg_sources | |
wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz | |
tar xzvf yasm-1.3.0.tar.gz | |
cd yasm-1.3.0 | |
./configure | |
make | |
make install | |
sudo make install |
This file contains hidden or 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 net.koofr.finagle.thrift.stats | |
import com.twitter.finagle.SimpleFilter | |
import org.apache.thrift.protocol.TBinaryProtocol | |
import com.twitter.finagle.Service | |
import org.apache.thrift.transport.TMemoryInputTransport | |
import play.modules.statsd.api.Statsd | |
import com.twitter.finagle.thrift.ThriftClientRequest | |
import play.api.Logger |
This file contains hidden or 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
cue_file = 'file.cue' | |
d = open(cue_file).read().splitlines() | |
general = {} | |
tracks = [] | |
current_file = None |
This file contains hidden or 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
google-chrome --user-data-dir=`mktemp -d` |
This file contains hidden or 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
net = require('net') | |
tls = require('tls') | |
stream = require('stream') | |
if process.argv.length != 4 | |
console.log 'Usage: https_proxy host port' | |
process.exit(1) | |
class Printer extends stream.Transform | |
_transform: (chunk, encoding, done) => |