Skip to content

Instantly share code, notes, and snippets.

View ta1hia's full-sized avatar
🌴
gone fishin' (05/15/2025 - 06/03/2025)

tahia ta1hia

🌴
gone fishin' (05/15/2025 - 06/03/2025)
View GitHub Profile
@jkulton
jkulton / README.md
Last active August 24, 2022 02:45
Terraform Import/Export

Terraform Import/Export

If you need to move resources between Terraform projects but they aren't configured in such a way you can directly run tf state move to move them between modules you can follow this process for migrating resources between terraform projects.

Commands Used

@gangefors
gangefors / Install FreeNAS SCALE on a partition and create a mirror.md
Last active May 20, 2025 13:57
How to install TrueNAS SCALE on a partition instead of the full disk

Install TrueNAS SCALE on a partition instead of the full disk

The TrueNAS installer doesn't have a way to use anything less than the full device. This is usually a waste of resources when installing to a modern NVMe which is usually several hundred of GB. TrueNAS SCALE will use only a few GB for its system files so installing to a 16GB partition would be helpful.

The easiest way to solve this is to modify the installer script before starting the installation process.

#!/usr/bin/env python
# vim:se sts=4 sw=4 et fenc=utf-8 ft=python:
import os.path
import pickle
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
#!/bin/sh
while read test_name
do
dir=${test_name%/*}
test=${test_name##*/}
for f in ${dir}/*.ini
do
awk <$f "//; \$1 == \"[${test}]\" { print \"fail-if = fission\" }" |
#!/usr/bin/env python
# vim:se sts=4 sw=4 et fenc=utf-8 ft=python:
import json
import os
import re
import sys
import urllib.parse
from urllib.parse import parse_qs, urlparse
import requests
@lightdiscord
lightdiscord / netlify.sh
Last active July 5, 2021 15:20
Rust and wasm and netlify
#!/usr/bin/env bash
set -e
cweb_version=0.6.16
cweb=https://github.com/koute/cargo-web/releases/download/$cweb_version/cargo-web-x86_64-unknown-linux-gnu.gz
curl -Lo cargo-web.gz $cweb
gunzip cargo-web.gz
chmod u+x cargo-web
@lightdiscord
lightdiscord / default.nix
Last active October 13, 2022 04:41
Rust and wasm with nixos
with import <nixpkgs> {
overlays = map (uri: import (fetchTarball uri)) [
https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz
];
};
stdenv.mkDerivation {
name = "rust-wasm";
buildInputs = [
cargo-web
@itod
itod / split_keyboards.md
Last active April 26, 2025 15:22
Every "split" mechanical keyboard currently being sold that I know of
@gwillem
gwillem / ansible-bootstrap-ubuntu-16.04.yml
Created June 16, 2016 21:59
Get Ansible to work on bare Ubuntu 16.04 without python 2.7
# Add this snippet to the top of your playbook.
# It will install python2 if missing (but checks first so no expensive repeated apt updates)
# [email protected]
- hosts: all
gather_facts: False
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
from collections import deque
def permutations(word):
if len(word) == 1:
return [word]
perms = permutations(word[1:])
c = word[0]
res = []