Skip to content

Instantly share code, notes, and snippets.

@da-moon
da-moon / vimeo-download.py
Created March 12, 2023 14:14 — forked from alexeygrigorev/vimeo-download.py
Downloading segmented video from vimeo
import requests
import base64
from tqdm import tqdm
master_json_url = 'https://178skyfiregce-a.akamaihd.net/exp=1474107106~acl=%2F142089577%2F%2A~hmac=0d9becc441fc5385462d53bf59cf019c0184690862f49b414e9a2f1c5bafbe0d/142089577/video/426274424,426274425,426274423,426274422/master.json?base64_init=1'
base_url = master_json_url[:master_json_url.rfind('/', 0, -26) + 1]
resp = requests.get(master_json_url)
content = resp.json()

Conventinal Commit Messages

See how a minor change to your commit message style can make a difference. Examples

Have a look at CLI util git-conventional-commits to ensure this conventions and generate changelogs

Commit Formats

Default

@da-moon
da-moon / ca.md
Created October 14, 2022 12:44 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@da-moon
da-moon / arch-linux-pixelbook.md
Last active September 15, 2020 21:16 — forked from daemonp/encrypted-root-arch-linux-pixelbook.md
Installing Arch Linux on a Google Pixelbook (i7 16gb 500gb NVMe)

Overview

Stable enough for my initial use-case, light-duty laptop for travel and presentations, running Linux all the time but retain a small ChromeOS volume for firmware updates and restoring settings.

1st attempt I wiped the drive and then found that when the machine attempted to suspect when the lid closed it wiped the NVRAM with no other option to boot into legacy mode than to restore ChromeOS and enable it again.

  • Setup base system in ChromeOS
  • Fully encrypted Btrfs root partition & ext4 boot
  • Install Arch Linux
@da-moon
da-moon / sakura_init.sh
Created April 20, 2020 19:21 — forked from marcy-terui/sakura_init.sh
Disable PasswordAuthentication and Enable PubkeyAuthentication on Sakura VPS.
USER_NAME=marcy
sed -i "s/.*RSAAuthentication.*/RSAAuthentication yes/g" /etc/ssh/sshd_config
sed -i "s/.*PubkeyAuthentication.*/PubkeyAuthentication yes/g" /etc/ssh/sshd_config
sed -i "s/.*PasswordAuthentication.*/PasswordAuthentication no/g" /etc/ssh/sshd_config
sed -i "s/.*AuthorizedKeysFile.*/AuthorizedKeysFile\t\.ssh\/authorized_keys/g" /etc/ssh/sshd_config
sed -i "s/.*PermitRootLogin.*/PermitRootLogin no/g" /etc/ssh/sshd_config
echo "${USER_NAME} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
service sshd restart
@da-moon
da-moon / windows-10-optimization-script.ps1
Last active February 27, 2023 09:49
Windows 10 Optimization Script
##########
# Win10 Optimization Script With Extra GPD Win Tweaks
# Adapted version of https://github.com/Disassembler0/Win10-Initial-Setup-Script by Disassembler <[email protected]>
# Author: BlackDragonBE
# Version: v2.2.1 (2017-12-02)
# Copied from https://www.reddit.com/r/gpdwin/comments/6ipa6c/windows_10_optimization_script_for_gpd_win/
##########
<#
Copyright:

UB-Touch installer

1- download and extract flo-newkernel-2.zip from https://github.com/ubports/ubuntu-touch/issues/300#issuecomment-450403133 2- after extracting , run the following :

fastboot flash boot flo-boot-new.img
fastboot flash recovery flo-recovery-new.img

3- download and install ubuntu-device-flash

@da-moon
da-moon / ping
Last active February 11, 2020 19:15
COE-865 : Lab2
cat >> ping << EOF
#!/usr/bin/env bash
traceroute 10.5.2.2
traceroute 10.5.1.1
traceroute 10.5.1.2
traceroute 10.5.4.1
traceroute 10.5.4.2
traceroute 10.5.3.1
traceroute 10.5.3.2
$remoteport = bash.exe -c "ifconfig eth0 | grep 'inet '"
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
if( $found ){
$remoteport = $matches[0];
} else{
echo "The Script Exited, the ip address of WSL 2 cannot be found";
exit;
}
https://scene-si.org/2016/06/13/advanced-go-tips-and-tricks/
https://medium.com/@trevor4e/learning-gos-concurrency-through-illustrations-8c4aff603b3
https://golangcode.com/run-code-once-with-sync/
https://bbengfort.github.io/snippets/2017/02/21/synchronizing-structs.html