Skip to content

Instantly share code, notes, and snippets.

@odixon
odixon / AdGuardHome-DNSOnly-docker-compose.yml
Created March 20, 2023 14:19 — forked from brav0charlie/AdGuardHome-DNSOnly-docker-compose.yml
AdGuard Home (No DHCP) in Docker using Docker-Compose
# NOTE: While AdGuard Home may be configured as a DHCP server, this is out
# out of scope for this docker-compose.yml file. Configuring the DHCP
# server requires using 'network_mode: host'.
#
# If you want to use the DHCP server feature, delete the 'network:'
# section (lines 20 & 21), as well as the entire 'ports:' section
# (lines 30 - 47). Then, just below the 'restart:' section (line 19)
# insert a line that reads 'network_mode: host'. The container will
# still reserve all the ports listed below, as well as 67 and 68 for
# DHCP, but there's no need to map them in the docker-compose.yml file
@odixon
odixon / gist:15e26e3354c722ff4330fe0ae77a2fa4
Created January 23, 2023 21:26 — forked from e1024kb/gist:41bf38fdb1a2cb19a781
Country - state list in JSON
{
"countries": [
{
"country": "Afghanistan",
"states": ["Badakhshan", "Badghis", "Baghlan", "Balkh", "Bamian", "Daykondi", "Farah", "Faryab", "Ghazni", "Ghowr", "Helmand", "Herat", "Jowzjan", "Kabul", "Kandahar", "Kapisa", "Khost", "Konar", "Kondoz", "Laghman", "Lowgar", "Nangarhar", "Nimruz", "Nurestan", "Oruzgan", "Paktia", "Paktika", "Panjshir", "Parvan", "Samangan", "Sar-e Pol", "Takhar", "Vardak", "Zabol"]
},
{
"country": "Albania",
"states": ["Berat", "Dibres", "Durres", "Elbasan", "Fier", "Gjirokastre", "Korce", "Kukes", "Lezhe", "Shkoder", "Tirane", "Vlore"]
},
@odixon
odixon / states_hash.json
Created January 23, 2023 21:26 — forked from mshafrir/states_hash.json
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="your-old-email@example.com"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="your-correct-email@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
@odixon
odixon / scrapy.md
Created January 14, 2020 20:31 — forked from bradtraversy/scrapy.md
Scrapy commands and code
@odixon
odixon / gist:bf8d3b8e679c75ffb1cdd4aff255a96a
Created November 12, 2019 22:52 — forked from belsrc/gist:672b75d1f89a9a5c192c
Simple Vue.js filters that I usually need
/**
* Changes value to past tense.
* Simple filter does not support irregular verbs such as eat-ate, fly-flew, etc.
* http://jsfiddle.net/bryan_k/0xczme2r/
*
* @param {String} value The value string.
*/
Vue.filter('past-tense', function(value) {
// Slightly follows http://www.oxforddictionaries.com/us/words/verb-tenses-adding-ed-and-ing
var vowels = ['a', 'e', 'i', 'o', 'u'];
@odixon
odixon / find_facial_features_in_picture.py
Created October 17, 2019 13:34 — forked from peterjpxie/find_facial_features_in_picture.py
find_facial_features_in_picture.py
from PIL import Image, ImageDraw
import face_recognition
image_file = 'obama.jpg'
# Load the jpg file into a numpy array
image = face_recognition.load_image_file(image_file)
# Find all facial features in all the faces in the image
face_landmarks_list = face_recognition.face_landmarks(image)
@odixon
odixon / 1-server.md
Created October 8, 2019 20:58 — forked from dragonjet/1-server.md
Setup Web Server on EC2 Amazon Linux AMI

Step 1: Server Credentials

This assumes you are now connected to the server via SSH.

  • sudo -s Enter root mode for admin access
  • groupadd devgroup Create new group to be later granted access to /var/www/html

Creating a new Root User

  • useradd -G root,devgroup masterdev Create new root user. Also add to the devgroup
  • passwd masterdev Change password for the new root user
  • At this point, you'll need to input your new root user's new password
@odixon
odixon / snake-nginx.nix
Created September 19, 2019 19:15 — forked from thoughtpolice/snake-nginx.nix
A complete example of a working Hydra build machine and other stuff.
let
# Wrap a nginx server block in an HTTPS site
wrapSSL = site: cert: key: block: ''
server {
listen 80;
listen [::]:80;
server_name ${site};
location /nginx_status {
stub_status on;
@odixon
odixon / node_redis_cache.js
Created August 20, 2019 21:07 — forked from bradtraversy/node_redis_cache.js
Node.js & Redis Caching
const express = require('express');
const fetch = require('node-fetch');
const redis = require('redis');
const PORT = process.env.PORT || 5000;
const REDIS_PORT = process.env.PORT || 6379;
const client = redis.createClient(REDIS_PORT);
const app = express();