$ brew install unbound ldns
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 | |
# run on mac in terminal | |
while TRUE; do | |
nc <server_address> 15000 | play -q -t mp3 - || echo Attempting to connect... | |
sleep 1; | |
done |
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
""" | |
Tested on Linux with python 3.7 | |
Must have portaudio installed (e.g. dnf install portaudio-devel) | |
pip install pyqtgraph pyaudio PyQt5 | |
""" | |
import numpy as np | |
import pyqtgraph as pg | |
import pyaudio | |
from PyQt5 import QtCore, QtGui |
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
from PySide import QtCore, QtGui | |
import sys | |
app = QtGui.QApplication(sys.argv) | |
QtGui.qApp = app | |
folderTree = QtGui.QTreeWidget() | |
header = QtGui.QTreeWidgetItem(["Virtual folder tree","Comment"]) | |
#... |
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 | |
import re, math | |
def LoadPPLFile (pplfile) : | |
""" | |
Load up the salient info from a -debug 2 PPL file | |
generated by the SRILM ngram tool. | |
""" | |
ppl_info = [] |
Add these lines to the end of /etc/sysctl.conf:
vm.swappiness=5
vm.min_free_kbytes=122880
vm.vfs_cache_pressure=500
Run these commands as root:
sudo sysctl -w vm.swappiness=5;
sudo sysctl -w vm.min_free_kbytes=122880
Hi:
perl -e 'print "hello world!\n"'
A simple filter:
perl -ne 'print if /REGEX/'
Filter out blank lines (in place):
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
; Autohotkey Capslock Remapping Script | |
; Danik | |
; More info at http://danikgames.com/blog/?p=714 | |
; danikgames.com | |
; | |
; Functionality: | |
; - Deactivates capslock for normal (accidental) use. | |
; - Hold Capslock and drag anywhere in a window to move it (not just the title bar). | |
; - Access the following functions when pressing Capslock: | |
; Cursor keys - J, K, L, I |
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 requests, random, datetime, sys, webbrowser, console | |
def main(): | |
song_page = None | |
if (len(sys.argv) > 0): | |
try: | |
song_page = sys.argv[1] | |
except Exception: | |
song_page = None | |
if not song_page: |
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
def get_uncompressed_size(self, file): | |
fileobj = open(file, 'r') | |
fileobj.seek(-8, 2) | |
crc32 = gzip.read32(fileobj) | |
isize = gzip.read32(fileobj) # may exceed 2GB | |
fileobj.close() | |
return isize |