Skip to content

Instantly share code, notes, and snippets.

Avatar

Tim Sabat tsabat

View GitHub Profile
@tsabat
tsabat / zsh.md
Last active May 25, 2021
Getting oh-my-zsh to work in Ubuntu
View zsh.md

Prereq:

apt-get install zsh
apt-get install git-core

Getting zsh to work in ubuntu is weird, since sh does not understand the source command. So, you do this to install zsh

wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
@tsabat
tsabat / supervisor.conf
Created Dec 28, 2011
Sample supervisor config file
View supervisor.conf
; Sample supervisor config file.
[unix_http_server]
file=/tmp/supervisor.sock ; (the path to the socket file)
;chmod=0700 ; sockef file mode (default 0700)
;chown=nobody:nogroup ; socket file uid:gid owner
;username=user ; (default is no username (open server))
;password=123 ; (default is no password (open server))
;[inet_http_server] ; inet (TCP) server disabled by default
@tsabat
tsabat / redis_clients.sh
Created Sep 7, 2013
a unique list of all connected redis clients
View redis_clients.sh
redis-cli client list | awk '{print $1}' | sed s/addr=//g | sed s/:.*//g | uniq
@tsabat
tsabat / settings.py
Created Feb 7, 2021 — forked from defulmere/settings.py
How to override an old sqlite3 module with pysqlite3 in django settings.py
View settings.py
# first: pip install pysqlite3-binary
# then in settings.py:
# these three lines swap the stdlib sqlite3 lib with the pysqlite3 package
__import__('pysqlite3')
import sys
sys.modules['sqlite3'] = sys.modules.pop('pysqlite3')
DATABASES = {
'default': {
View HTML5-Audio-Player-w--Responsive-Playlist.markdown

HTML5 Audio Player w/ Responsive Playlist

I changed this!

This is an HTML5 audio player that detects the user agent of your device/browser/OS and applies styling that matches the native audio player. The playlist responds to the width of your screen and features basic UI controls.

Feel free to fork this pen and add your own user agent styles for different browsers, devices and operating systems.

@tsabat
tsabat / unused.py
Created Feb 22, 2014
delete unused ebs volumes
View unused.py
#! env python
from boto import ec2
conn = ec2.connect_to_region('us-west-2')
vols = conn.get_all_volumes(filters={'status': 'available'})
for vol in vols:
print 'checking vol:', vol.id, 'status:', vol.status, 'attachment_id:', vol.attach_data.status
conn.delete_volume(vol.id)
View stuff.txt
1) "schedules_changed"
2) "stat:processed:2018-08-06"
3) "stat:failed:2018-09-06"
4) "stat:failed:2020-03-01"
5) "stat:failed:2020-01-12"
6) "stat:failed:2018-10-12"
7) "stat:processed:2018-09-01"
8) "stat:processed:2019-09-27"
9) "stat:failed:2020-02-23"
10) "stat:processed:2018-12-08"
@tsabat
tsabat / port_forward.md
Last active Mar 26, 2020
port forwarding bash script
View port_forward.md

We hide the services behind an AWS Security Group. But, we can use some trusty SSH action to forward localhost ports to those on the Solr server.

After you've added this to your ~/.zshrc or ~/.bash_profile and sourced (source ~/.bash_profile) it, you can forward these ports from localhost to your server like so:

portforward <hostname>

zsh and bash handle string splitting differently, so be sure to choose correctly for your shell.

View product.json
{
"product_id": "HL-104",
"product_name": "32-oz. Pail with Handle",
"description": "HumphreyLine 32-ounce pail is made with premium materials. Optional (non-decorated) White Lid available at US $0.25/CDN $0.50 (G) each. Optional Shovels also available at US $0.25/CDN $0.50 (G) each. Pail includes handle. Must specify handle color. Handles and Optional Shovels are available in: White, Red, Blue or Black. All optional accessories packed separately. Made in USA. FOB ZIP: KY, 41042",
"product_marketing_point_array": {
"product_marketing_point": {
"point_type": "downloads-Art Template",
"point_copy": "Click on the PDF link below to download: <br /><a href=\"/Lists/ReferenceMaterialLibrary/Bullet/Art_Templates/HL-104 32 oz Sand Pail.ai\" >HL-104 32 oz Sand Pail</a>"
}
},