Skip to content

Instantly share code, notes, and snippets.

@marioBonales
marioBonales / .bashrc
Created January 19, 2012 03:56
Default .bashrc for ubuntu
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@willurd
willurd / web-servers.md
Last active April 18, 2024 14:15
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@kfigiela
kfigiela / _README.md
Last active July 13, 2023 10:14
Traktor Kontrol S5 S8 hacks

Warnings and instructions

  • You need to modify some Traktor files – do backup before you try – if files are incorrects screens become black.
  • You're doing that at your own risk!
  • If sth goes really bad – reinstall Traktor :-)
  • Traktor QML files are located by default in /Applications/Native Instruments/Traktor 2/Traktor.app/Contents/Resources/qml on Mac, on Windows look for qml in directory where Traktor is installed (I don't have windows machine around)…
  • You need real text-editor to modify files, you should try with Atom or Notepad++ to apply modifications
  • Files here are so called diff files, here is how to read them: http://stackoverflow.com/questions/2529441/how-to-read-the-output-from-git-diff

Hacks

@copperlight
copperlight / .bashrc
Created August 11, 2016 16:27
Window Subsystem for Linux ssh-agent Configuraton
# ... more above ...
# wsfl bash is not a login shell
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# ssh-agent configuration
if [ -z "$(pgrep ssh-agent)" ]; then
rm -rf /tmp/ssh-*
@ziadoz
ziadoz / install.sh
Last active April 7, 2024 16:04
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# https://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# https://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# https://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# https://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE`
@pythoninthegrass
pythoninthegrass / uninstall_mso.sh
Last active April 20, 2021 00:02 — forked from pirafrank/uninstall_office_2016.sh
Uninstall Microsoft Office from macOS completely
#!/usr/bin/env bash
# SOURCES:
# https://gist.github.com/pirafrank/18d62c062e2806c1d183
# SEE THIS EXCELLENT SITE IF GIST FAILS:
# https://office-reset.com
# activate verbose standard output (stdout)
set -v
@crh0831
crh0831 / config.yaml
Created July 21, 2018 14:34
Beets config
directory: /mnt/chawley/Music
library: /home/chawley/musiclibrary.blb
import:
# write metadata to music files
write: yes
# move imported files from source to the music directory
move: yes
copy: no
@kekru
kekru / 01nginx-tls-sni.md
Last active April 1, 2024 02:29
nginx TLS SNI routing, based on subdomain pattern

Nginx TLS SNI routing, based on subdomain pattern

Nginx can be configured to route to a backend, based on the server's domain name, which is included in the SSL/TLS handshake (Server Name Indication, SNI).
This works for http upstream servers, but also for other protocols, that can be secured with TLS.

prerequisites

  • at least nginx 1.15.9 to use variables in ssl_certificate and ssl_certificate_key.
  • check nginx -V for the following:
    ...
    TLS SNI support enabled
@atruskie
atruskie / terminal-keybind.ahk
Last active December 30, 2022 15:44
AutoHotkey script to bind Win+~ keyboard shortcut to Windows Terminal
#NoEnv
#SingleInstance force
SendMode Input
DetectHiddenWindows, on
SetWinDelay, 0
#`::
terminal := WinExist("ahk_exe WindowsTerminal.exe")
if (terminal)
{
@Bahus
Bahus / json_schemed_field.py
Last active November 15, 2023 10:12
Django JSONField with Pydantic schema support
from functools import partial
import pydantic
import logging
from django.contrib.postgres.fields import JSONField
from typing import Type, Union, Tuple
from django.core.serializers.json import DjangoJSONEncoder