Skip to content

Instantly share code, notes, and snippets.

@IgnoredAmbience
IgnoredAmbience / 99-noto-mono-color-emoji.conf
Last active October 25, 2024 06:01
Noto Emoji Color fontconfig for Konsole
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!--
Noto Mono + Color Emoji Font Configuration.
Currently the only Terminal Emulator I'm aware that supports colour fonts is Konsole.
Usage:
0. Ensure that the Noto fonts are installed on your machine.
1. Install this file to ~/.config/fontconfig/conf.d/99-noto-mono-color-emoji.conf
@Ulexus
Ulexus / asterisk.service
Last active April 14, 2022 22:08
Asterisk systemd unit
[Unit]
Description=Asterisk PBX And Telephony Daemon
After=network.target
[Service]
User=asterisk
ExecStart=/usr/sbin/asterisk -f -C /etc/asterisk/asterisk.conf
ExecStop=/usr/sbin/asterisk -rx 'core stop now'
ExecReload=/usr/sbin/asterisk -rx 'core reload'
@dbapl
dbapl / .gitattributes
Last active August 1, 2024 14:33 — forked from kbaird/git_binary_diff_gist
Diff setup for ~/.gitconfig, .gitattributes file for repository and helper scripts.
*.ods diff=odf
*.odt diff=odf
*.odp diff=odf
*.pdf diff=pdf
*.PDF diff=pdf
*.apk diff=apk
*.bz2 diff=bz2
*.gz diff=gzip
*.zip diff=zip
*.tar diff=tar
@pretorh
pretorh / Listing watched files on kodi (xbmc).md
Last active May 23, 2022 16:58
Listing watched files on kodi (xbmc)

Listing watched files on kodi (xbmc)

To list the full path of all watched files that are still accessable: (assuming the sql query was saved to list-watched-files.sql)

sqlite3 ~/.kodi/userdata/Database/MyVideos90.db < list-watched-files.sql | xargs -L 1 -I filename ls "filename" 2>/dev/null

Explanation

Get the list of watched files from the Kodi database

Kodi uses sqlite databases, located in ~/.kodi/userdata/Database/. The video database is MyVideosXX.db, where XX is the version (MyVideos90.db on OSMC on 2015-05-09)

@minhoryang
minhoryang / 1-twisted-https.py
Last active January 24, 2018 12:21
Using SSL Certificate, PrivateKey, CertChains with Python Flask/Twisted
from OpenSSL.crypto import load_privatekey, load_certificate, FILETYPE_PEM
#from OpenSSL.SSL import SSLv3_METHOD
from twisted.internet import reactor
from twisted.internet.ssl import CertificateOptions, DefaultOpenSSLContextFactory, DiffieHellmanParameters
from twisted.web import proxy, server
from twisted.python.filepath import FilePath
sample_site = server.Site(proxy.ReverseProxyResource('localhost', 80, '')) # ignore it.
# AES256-SHA
@daniellevass
daniellevass / android_material_design_colours.xml
Last active September 9, 2024 06:08
Android Material Design Colours
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- google's material design colours from
http://www.google.com/design/spec/style/color.html#color-ui-color-palette -->
<!--reds-->
<color name="md_red_50">#FFEBEE</color>
<color name="md_red_100">#FFCDD2</color>
<color name="md_red_200">#EF9A9A</color>
@twocity
twocity / build.gradle
Last active December 11, 2021 09:13
android gradle change output apk file name.
android.applicationVariants.all { variant ->
println "*********" + variant.description + "**********";
def variants = variant.baseName.split("-");
def apkName = "ricebook-";
apkName += variants[0];
apkName += "-v" + android.defaultConfig.versionName;
if (!variant.zipAlign) {
apkName += "-unaligned";
}
if (variant.buildType.name == "release") {
@martijnvermaat
martijnvermaat / ssh-agent-forwarding-screen.md
Created December 21, 2013 15:06
SSH agent forwarding and screen

SSH agent forwarding and screen

When connecting to a remote server via SSH it is often convenient to use SSH agent forwarding so that you don't need a separate keypair on that server for connecting to further servers.

This is enabled by adding the

ForwardAgent yes

option to any of your Host entries in ~/.ssh/config (or alternatively with the -A option). Don't set this option in a wildcard Host * section since any user on the remote server that can bypass file permissions can now als use keys loaded in your SSH agent. So only use this with hosts you trust.

@jinnko
jinnko / mdadm-fastsync
Created August 12, 2013 10:58
Set disk values to maximize a resync, or restore the default settings. Dynamically detects the underlying volumes that make up the MD device. Based on the fine advice from Vivek Gite posted at http://www.cyberciti.biz/tips/linux-raid-increase-resync-rebuild-speed.html.
#!/bin/zsh
#
# @author Jinn Ko <https://gist.github.com/jinnko>
# @since 2013-08-11
MD_DEV=$1
ACTION=$2
MIN_SPEED=50000
MAX_SPEED=200000
@tylerneylon
tylerneylon / learn.lua
Last active October 22, 2024 01:07
Learn Lua quickly with this short yet comprehensive and friendly script. It's written as both an introduction and a quick reference. It's also a valid Lua script so you can verify that the code does what it says, and learn more by modifying and running this script in your Lua interpreter.
-- Two dashes start a one-line comment.
--[[
Adding two ['s and ]'s makes it a
multi-line comment.
--]]
----------------------------------------------------
-- 1. Variables and flow control.
----------------------------------------------------