Skip to content

Instantly share code, notes, and snippets.

@endolith
endolith / A_weighting.py
Last active March 15, 2024 07:12
A-weighting audio files in Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Translated from a MATLAB script (which also includes C-weighting, octave
and one-third-octave digital filters).
Author: Christophe Couvreur, Faculte Polytechnique de Mons (Belgium)
couvreur@thor.fpms.ac.be
Last modification: Aug. 20, 1997, 10:00am.
BSD license
@mudge
mudge / nginx.conf
Created September 20, 2010 12:29
Nginx configuration to redirect requests for non-existent files to an external URI without using if.
# Redirect all requests for non-existent files to another web
# site, used on my own site to redirect people to my GitHub
# account page.
server {
server_name example.com;
location / {
try_files $uri $uri/index.html @external;
}
location @external {
rewrite ^ $scheme://anotherexample.com$request_uri redirect;
@reyjrar
reyjrar / New-iTerm-Window.scpt
Created February 8, 2012 13:14
AppleScript to Open a New iTerm Window and bring it to the front
(*
* New-iTerm-Window.scpt
*
* Intended for use with QuickSilver
* I mapped option-y to running this script to create
* a new iTerm window on the current workspace
*
* Based on much Googling - very little "original" code here
* Comments/Suggestions to brad.lhotsky@gmail.com
*)
@ib-lundgren
ib-lundgren / github_flask_oauth2.py
Created September 10, 2013 10:53
Example of how to use Flask with requests-oauthlib to fetch a GitHub user profile using an OAuth 2 token.
from requests_oauthlib import OAuth2Session
from flask import Flask, request, redirect, session, url_for
from flask.json import jsonify
import os
app = Flask(__name__)
# This information is obtained upon registration of a new GitHub
client_id = "<your client key>"
@shamil
shamil / mount_qcow2.md
Last active May 13, 2024 18:58
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
@anthonywong
anthonywong / 20-noto-cjk.conf
Last active September 18, 2017 22:47
思源/Noto CJK fonconfig 設定檔
<fontconfig>
<match target="pattern">
<test name="lang">
<string>zh-tw</string>
</test>
<test name="family">
<string>sans-serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Sans T Chinese</string>
This file has been truncated, but you can view the full file.
*M-UNKNOWN MEXICAN TRUCKING COMPANY
8CON CONTSHIP CONTAINER LINE
99M UNKNOWN MEXICAN OVERLAND CARRIER
AAAB AAA MOTORS
AAAC AAACTION TRANSPORTATION INC
AAAD A A A DELIVERY INC
AAAG ATC LOGISTICS INC
AAAO AAMODT INC
AAAU ASIA CONTAINER LEASING CO LTD
AAAW AAA WALKER TRANSPORTATION SERVICES
@adymo
adymo / gist:7b1e6db801ed6ae5c36f
Last active May 3, 2019 13:07
Kubuntu 15.04 Linux on Dell XPS 13 2015 High DPI Setup

Xorg resolution [works]

  • not detected automatically from edid
  • check physical screen dimensions with xrandr
  • put those into /etc/X11/xorg.conf.d/90-monitor.conf
      Section "Monitor"
        Identifier ""
        DisplaySize 293 165 # xrandr reports 294, but 293 makes it 277x277dpi instead of 276x277
      EndSection
    
    
@loderunner
loderunner / 01-mac-profiling.md
Last active May 12, 2024 14:43
Profiling an application in Mac OS X

Profiling an application in Mac OS X

Finding which process to profile

If your system is running slowly, perhaps a process is using too much CPU time and won't let other processes run smoothly. To find out which processes are taking up a lot of CPU time, you can use Apple's Activity Monitor.

The CPU pane shows how processes are affecting CPU (processor) activity:

@cloudnull
cloudnull / existing-inventory-redeployment.rst
Last active September 24, 2015 07:59
existing-inventory-redeployment.rst

Redeploying using the existing inventory is completely possible and will minimize the changes needing to be done on the F5.

Potential plan of action (this is just my mutterings, likely will need slight revision)

  1. destroy all of the juno containers throughout the whole environment.
ansible hosts -m shell -a 'for i in $(lxc-ls); do lxc-destroy -fn $i; done'