Skip to content

Instantly share code, notes, and snippets.

View darth-veitcher's full-sized avatar

James Veitch darth-veitcher

View GitHub Profile
@darth-veitcher
darth-veitcher / cloudflare-update-record.sh
Created July 31, 2016 15:03 — forked from benkulbertis/cloudflare-update-record.sh
Cloudflare API v4 Dynamic DNS Update in Bash
#!/bin/bash
# CHANGE THESE
auth_email="[email protected]"
auth_key="c2547eb745079dac9320b638f5e225cf483cc5cfdda41" # found in cloudflare account settings
zone_name="example.com"
record_name="www.example.com"
# MAYBE CHANGE THESE
ip=$(curl -s http://ipv4.icanhazip.com)

How to download your Udemy course videos using youtube-dl

$ youtube-dl --list-extractors | grep udemy

Steps

  1. Get link to the course to download. e.g. https://www.udemy.com/course-name/
  2. Login into udemy website, save the cookie from chrome using Chrome (Cookie.txt)[1] export extension. Save it to file udemy-cookies.txt
  3. Get the link of the video that you want to download. usually in format. Use the command provided below where you have to replace the {course_link} and {path_to_cookies_file} with respective paths.
$ youtube-dl {course_link} --cookies {path_to_cookies_file}
@darth-veitcher
darth-veitcher / database_to_parquet.py
Created February 16, 2021 20:29 — forked from rvaidya/database_to_parquet.py
Dump database table to parquet file using sqlalchemy and fastparquet. Useful for loading large tables into pandas / Dask, since read_sql_table will hammer the server with queries if the # of partitions/chunks is high. Using this you write a temp parquet file, then use read_parquet to get the data into a DataFrame
import pandas as pd
import numpy as np
import fastparquet
from sqlalchemy import create_engine, schema, Table
# Copied from pandas with modifications
def __get_dtype(column, sqltype):
import sqlalchemy.dialects as sqld
@darth-veitcher
darth-veitcher / auth.go
Created July 4, 2021 13:53 — forked from ogazitt/auth.go
Auth0 PKCE flow for a CLI built in golang
package auth
import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net"
"net/http"
"net/url"
@darth-veitcher
darth-veitcher / wireguard-over-tcp.md
Created August 31, 2021 13:15
WireGuard over TCP with udptunnel

WireGuard over TCP with udptunnel

udptunnel is a small program which can tunnel UDP packets bi-directionally over a TCP connection. Its primary purpose (and original motivation) is to allow multi-media conferences to traverse a firewall which allows only outgoing TCP connections.

Server

# udptunnel -s 443 127.0.0.1/51820

Client

@darth-veitcher
darth-veitcher / gizmoscribe.css
Created October 9, 2021 15:32 — forked from johnnygizmo/gizmoscribe.css
BattleScribe Replacement CSS Version 1
/*
This file is based off the CSS output of the BattleScribe App. This is only meant to pretty up the output a little
Instructions:
1: Create a folder for your rosters
2: Place this file (gizmoscribe.css) in the folder
3: Place a png image file (make sure it's square) with your army logo in the same folder and call it logo.png
4: Save your rosters in HTML format to the folder
5: Edit the HTML files in a text Editor of choice (notepad, notepad++, etc)
@darth-veitcher
darth-veitcher / gist:0753253a748a4d519d09f3fd6433100f
Created October 20, 2021 13:53 — forked from 480/gist:3b41f449686a089f34edb45d00672f28
MacOS X + oh my zsh + powerline fonts + visual studio code terminal settings

MacOS X + oh my zsh + powerline fonts + visual studio code (vscode) terminal settings

Thank you everybody, Your comments makes it better

Install oh my zsh

http://ohmyz.sh/

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
@darth-veitcher
darth-veitcher / HowTo
Created February 23, 2022 11:32 — forked from whoisxiang/HowTo
Ubuntu 20.04.3 AutoInstall
# Docs:
- https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls
- https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls/ConfigReference
- https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html
- https://discourse.ubuntu.com/t/please-test-autoinstalls-for-20-04/15250/53
# Download ISO Installer:
wget https://ubuntu.volia.net/ubuntu-releases/20.04.3/ubuntu-20.04.3-live-server-amd64.iso
# Create ISO distribution dirrectory:
@darth-veitcher
darth-veitcher / README.md
Created February 23, 2022 15:06 — forked from djjudas21/README.md
MicroK8s, Ingress and MetalLB

Ingress MetalLB

Out of the box, the MicroK8s distribution of ingress-nginx installed as the MicroK8s addon ingress binds to ports 80+443 on the node's IP address using a hostPort, as we can see here:

microk8s kubectl -n ingress describe daemonset.apps/nginx-ingress-microk8s-controller
Name:           nginx-ingress-microk8s-controller
Selector:       name=nginx-ingress-microk8s
@darth-veitcher
darth-veitcher / terminal-with-powerline.sh
Created May 10, 2022 21:53 — forked from lirantal/terminal-with-powerline.sh
Hyper terminal + Powerline 9k terminal theme for oh-my-zsh
# Use hyper.is or iTerm2 as terminal emulators
# Install ohmyzsh
# https://github.com/robbyrussell/oh-my-zsh
# Copy over configs from ~/.bash_profile
# For example, it may have the nvm setup or any aliases like exa=ls and cat=bat
# ~/.hyper.js configuration:
copyOnSelect: true