Skip to content

Instantly share code, notes, and snippets.

View niikoo's full-sized avatar
🐌

Nikolai Ommundsen niikoo

🐌
View GitHub Profile
@dreamwhite
dreamwhite / gsync_adapters.md
Created April 11, 2021 11:09
[Google Sync Adapters] How to sync them with microG

Mammamia Marcello what's this?

I know what you're thinking of while reading this gist, but I don't have much spare time to setup a Nextcloud server for syncing my contacts and my calendar This guide is intended for those users like me (lazy af) who wanna sync contacts and calendar with Google server, even if using microG.

Requirements

@djfdyuruiry
djfdyuruiry / README.md
Last active April 28, 2024 08:34
WSL 2 - Enabling systemd

Enable systemd in WSL 2

NOTE: If you have Windows 11 there is now an official way to do this in WSL 2, use it if possible - see MS post here (WINDOWS 11 ONLY)

This guide will enable systemd to run as normal under WSL 2. This will enable services like microk8s, docker and many more to just work during a WSL session. Note: this was tested on Windows 10 Build 2004, running Ubuntu 20.04 LTS in WSL 2.

  • To enable systemd under WSL we require a tool called systemd-genie

  • Copy the contents of install-sg.sh to a new file /tmp/install-sg.sh:

@da-n
da-n / zfs-load-key.service
Last active September 20, 2022 13:19
Import ZFS pool
# This service will unlock all ZFS pools at boot time
# It should live in
# /etc/systemd/system/zfs-load-key.service
# Enable it with
# systemctl enable zfs-load-key.service
[Unit]
Description=Load encryption keys
DefaultDependencies=no
Before=zfs-mount.service
@leo6104
leo6104 / ng-update-v6.js
Last active December 21, 2021 00:05
Convert .angular-cli.json to angular.json (for Angular 6 Migration from Angular 2/4/5)
/**
* Created by leo6104 (github.com/leo6104)
* You can use this nodejs script on angular v5/v4/v2 project.
* 1. Place this gist file `ng-update-v6.js` to angular project's root path
* 2. use command `node ng-update-v6.js .angular-cli.json`
* 3. check angular.json file (created by ng-update-v6.js)
**/
const fs = require('fs');
const path = require('path');

Save list of all files on drive:

dir /S /B /OGN > C:\files-S.txt

Find out what last woke the computer:

powercfg -lastwake

Startup dir:

Win+R → shell:startup

Install Windows without a Microsoft account:

@pwlin
pwlin / gist:8a0d01e6428b7a96e2eb
Last active May 6, 2024 10:50
Android : add cert to system store
https://code.google.com/p/android/issues/detail?id=32696#c5
If you have a certificate that is not
trusted by Android, when you add it, it goes in the personal cert store.
When you add a cert in this personal cert store, the system requires a
higher security level to unlock the device. But if you manage to add your
cert to the system store then you don't have this requirement. Obviously,
root is required to add a certificate to the system store, but it is quiet
easy.
@aholmes
aholmes / print_ascii_art.js
Last active January 17, 2022 13:44
Prints ASCII art in your console.
var art=' :.+8.\n\
I=.$= O\n\
7O?7D?O~I$\n\
,+Z?+OI+:77\n\
~Z+?OO$OO7I\n\
.IOD?=$ZZO,\n\
OI~IZ+~8=,\n\
DDDDDDDDDDDDDDDDDDDD DDDD8 8DDDDDDDDDDDDDDDDDDDDD 7Z~+Z+$7D+?\n\
DDDDDDDDDDDDDDDDDDDD8 DDDD8 8DDDDDDDDDDDDDDDDDDDDD =$II$Z~IZ+\n\
DDDD8 DDDDD DDDD8 DDDDD ?$:==:~$O\n\
Squid required:
Mount HD (15GB min) on /tmp/cache, chmod -R 777 /tmp/cache
Firewall section:
config redirect
option src 'lan'
option proto 'tcp'
option src_ip '!192.168.1.1'
option src_dport '80'
option dest_ip '192.168.1.1'
@alexalouit
alexalouit / openwrt.squid.transparent
Last active April 11, 2022 21:25
OpenWRT Squid transparent configuration
Squid required:
Mount HD (15GB min) on /tmp/cache, chmod -R 777 /tmp/cache
Firewall section:
config redirect
option src 'lan'
option proto 'tcp'
option src_ip '!192.168.1.1'
option src_dport '80'
option dest_ip '192.168.1.1'
@atifaziz
atifaziz / XMLModule.bas
Created February 13, 2014 14:57
XML pretty printing in VBA
Function PrettyXML(ByVal Source, Optional ByVal EmitXMLDeclaration As Boolean) As String
Dim Writer As MXXMLWriter, Reader As SAXXMLReader
Set Writer = New MXXMLWriter
Writer.indent = True
Writer.omitXMLDeclaration = Not EmitXMLDeclaration
Set Reader = New SAXXMLReader
Set Reader.contentHandler = Writer
Reader.Parse Source
PrettyXML = Writer.Output