Skip to content

Instantly share code, notes, and snippets.

View arvati's full-sized avatar
💭
Studying online

Ademar Arvati arvati

💭
Studying online
View GitHub Profile
@arvati
arvati / firedemo.js
Created April 8, 2019 23:34 — forked from Easter-Egg/firedemo.js
Firebase client for Mithril
// mithrilFire usage demo
// using firebase database "dinosaur-facts"
var Dinosaurs = {
model: function() {
// return a firebase reference to our database
return new Firebase('https://dinosaur-facts.firebaseio.com');
},
controller: function() {
var data = Dinosaurs.model();
@arvati
arvati / gist:42df49d6abeccf103843e1a9358ee891
Last active April 9, 2019 11:49 — forked from julianlam/expose-directory-on-host-to-lxc-container.md
Exposing a directory on the host machine to an LXC container

Exposing a directory on the host machine to an LXC container

  1. Log into the container and create an empty directory, this will be the mount point
  2. Log out and stop the container.
  3. Open to your container's config file
    • For regular LXC containers: /var/lib/lxc/mycontainer/config
    • For unprivileged LXC containers: $HOME/.local/share/lxc/mycontainer/config
  4. Add a new line above the lxc.mount directive, that follows the format below. Substitute proper paths as necessary:
    • lxc.mount.entry = /path/to/folder/on/host /path/to/mount/point none bind 0 0
  • Both of these paths are relative to the host machine.
@arvati
arvati / code-server
Last active June 19, 2022 07:18
Install cdr/code-server on alpine (and debian) lxc
#!/sbin/openrc-run
name=$RC_SVCNAME
description="$name - VS Code on a remote server"
password="secret"
homedir="/root"
command="env PASSWORD=$password /usr/local/bin/$name"
server="0.0.0.0"
port="443"
command_args="--extensions-dir $homedir/.local/share/$name/extensions --host $server --user-data-dir $homedir/.local/share/$name --port $port --disable-telemetry --cert=$homedir/certs/$name.crt --cert-key=$homedir/certs/$name.key /srv"
command_user="root:root"
@arvati
arvati / SafeSignJCOP231Win64 w10.reg
Created June 10, 2019 23:17
SafeSign ATR JCOP231 win64 windows 10 registry key
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\Calais\SmartCards\VERSION 3.0.124 (1200b28038e8)]
"ATR"=hex:3b,dd,18,00,81,31,fe,45,80,f9,a0,00,00,00,77,01,08,00,07,90,00,fe
"Crypto Provider"="SafeSign Standard Cryptographic Service Provider"
"ATRMask"=hex:ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Cryptography\Calais\SmartCards\VERSION 3.0.124 (1200b28038e8)]
"ATR"=hex:3b,dd,18,00,81,31,fe,45,80,f9,a0,00,00,00,77,01,08,00,07,90,00,fe
"Crypto Provider"="SafeSign Standard Cryptographic Service Provider"
@arvati
arvati / onedrive.reg
Created June 10, 2019 23:19
registry key for one drive
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{018D5C66-4533-4307-9B53-224DE2ED1FE6}]
@="OneDrive"
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{E31EA727-12ED-4702-820C-4B6445F28E1A}]
@="Dropbox"
@arvati
arvati / updategodaddy.sh
Created July 10, 2019 16:40
Script to Update GoDaddy DNS dynamic up client
#!/bin/bash
# This script is used to check and update your GoDaddy DNS server to the IP address of your current internet connection.
# Special thanks to mfox for his ps script
# https://github.com/markafox/GoDaddy_Powershell_DDNS
#
# First go to GoDaddy developer site to create a developer account and get your key and secret
#
# https://developer.godaddy.com/getstarted
# Be aware that there are 2 types of key and secret - one for the test server and one for the production server
@arvati
arvati / new profiles.json
Last active May 8, 2020 21:53
Sample profiles.json for new Windows Terminal with git-cmd, wsl (wlinux and alpine), nodejs, psftp profiles
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{7f586916-8357-53d4-bb2b-ca96f639898a}",
"profiles":
@arvati
arvati / copy btrfs filesystem script.txt
Last active September 13, 2023 22:26
copy btrfs filesystem from one disk to another smaller one
sudo mount -t btrfs -o subvolid=0 /dev/sde /mnt/disk
sudo btrfs subvolume list -qu --sort ogen /mnt/disk
ID 257 gen 69317 top level 5 parent_uuid - uuid 5c2a18a4-3b47-f64e-afa9-34e75535a728 path rootfs
ID 339 gen 61638 top level 5 parent_uuid 5c2a18a4-3b47-f64e-afa9-34e75535a728 uuid 64cc0383-d122-a24f-a2c3-6f58839b52db path snap-rootfs-buster
sudo btrfs property set -ts /mnt/disk/rootfs ro true
sudo mount -t btrfs -o subvolid=0 /dev/sdb /mnt/usb
sudo btrfs send /mnt/disk/rootfs | sudo btrfs receive /mnt/usb/
@arvati
arvati / Install Grub.txt
Last active April 2, 2023 23:26
Reinstall Grub2
sudo mount -t btrfs /dev/sdb /mnt/disk
cd /mnt/disk
sudo mount --bind /dev dev
sudo mount -t proc proc proc
sudo mount -t sysfs sysfs sys
sudo chroot ./
ls /dev/disk/by-uuid -alh
nano /etc/grub.d/40_custom