Skip to content

Instantly share code, notes, and snippets.

View daryltucker's full-sized avatar

Daryl Tucker daryltucker

  • Neo-Retro Group
  • Salem, Or
View GitHub Profile
@daryltucker
daryltucker / flask.py
Last active October 12, 2023 13:31
Really disable logger logging in Flask
# I have my own logging setup and had a hard time disabling console output in Flask.
app.logger.disabled = True
log = logging.getLogger('werkzeug')
log.disabled = True
# New, 2022 Method:
logging.getLogger('werkzeug').disabled = True
@daryltucker
daryltucker / downgrade_thunderbird.mkd
Last active October 19, 2015 21:15
Downgrade Thunderbird 31.0

There are a few issues in Thunderbird 31.0 that render Thunderbird useless to me.

  1. Find available Thunderbird versions
  • apt-cache madison thunderbird
  1. Determine which version to use
  • 1:24.4.0+build1-0ubuntu1
  1. Downgrade to determined version
  • sudo apt-get install thunderbird=1:24.4.0+build1-0ubuntu1
  1. Send emails :D
@daryltucker
daryltucker / linux_kernel_compile.mkd
Last active August 29, 2015 14:05
Compiling a new Kernel using old configuration.

Copy current kernel configuration to linux source

cp -vi /boot/config-`uname -r` .config

Decide about new kernel options

Use the following if you wish to only build modules for devices currently in use/connected. For example, if you don't have any usb_storage devices, you won't be able to plug in usb drives.

make localmodconfig

Compile the kernel

make -j6

Compile kernel modules

@daryltucker
daryltucker / relative_tar_path.py
Created August 24, 2014 18:54
python - tarfile - Relative Paths
import tarfile
import glob
import tempfile
FILENAME = 'Title_for_your_file'
t_dir = t_dir = tempfile.mkdtemp(prefix='app-')
# Compress t_dir
tarname = '/tmp/%s.tar.bz2' % (FILENAME)
fileobj = open(tarname, 'wb')
@daryltucker
daryltucker / git-pull-global.sh
Last active August 29, 2015 14:06
Pull all git repositories within a specific directory.
#!/bin/bash
pwd=`pwd`
git_directory='/home/daryl/Projects/*'
for d in $git_directory;
do
echo $d
cd $d
git fetch --all
git pull --all
done
@daryltucker
daryltucker / whois.conf
Created October 14, 2014 21:44
/etc/whois.conf
##
# WHOIS servers for new TLDs (http://www.iana.org/domains/root/db)
# Current as of 2014-09-02
##
\.ac$ whois.nic.ac
\.academy$ whois.donuts.co
\.accountants$ whois.donuts.co
\.active$ whois.afilias-srs.net
\.actor$ whois.unitedtld.com
@daryltucker
daryltucker / url_norm.py
Created October 23, 2014 19:25
Normalize URLs
import urlparse
def url_norm(url, scheme='http'):
response = 0
try:
x = urlparse.urlsplit(url, scheme=scheme)
response = '%s://%s%s' % (x.scheme, x.netloc, x.path)
except Exception:
pass
@daryltucker
daryltucker / recv_all.py
Created November 21, 2014 22:04
Receive all data in socket buffer (python)
import socket
import ssl
'''
Receive all data in socket buffer, while preventing locking/blocking.
'''
sockx = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock = ssl.wrap_socket(sockx)
@daryltucker
daryltucker / keybase.md
Created January 13, 2015 18:12
keybase.md

Keybase proof

I hereby claim:

  • I am daryltucker on github.
  • I am daryltucker (https://keybase.io/daryltucker) on keybase.
  • I have a public key whose fingerprint is 30C2 3916 6664 6759 8C78 4733 0376 1EFF E29D 244C

To claim this, I am signing this object:

@daryltucker
daryltucker / install.mkd
Last active September 23, 2021 17:12
DeaDBeeF Ubuntu/Debian Compilation Dependencies

These were the weird things I needed to install before I could compile DeaDBeeF.

Ubuntu 20.04 / 2021

sudo apt install libvorbis-dev libogg-dev libflac-dev libzip-dev libjpeg-dev \
  libpng-dev libimlib2-dev libvorbis-dev libsamplerate0-dev libwavpack-dev libavformat-dev \
  libcdio-dev libcddb2-dev libavformat58 libavformat-dev libmpg123-dev autopoint libjansson-dev \
  libbison-dev libopus-dev libpulse-dev libcurl4-openssl-dev libdispatch-dev \
 yasm libtool intltool autoconf automake autopoint