Skip to content

Instantly share code, notes, and snippets.

View ph1048's full-sized avatar
🎯
Focusing

Alex ph1048

🎯
Focusing
View GitHub Profile
@ph1048
ph1048 / tutorial.md
Created July 22, 2023 08:18 — forked from Makeshift/tutorial.md
Tutorial for automatically syncing an Obsidian vault with Git on an Android device

How to sync Obsidian with Git on Android

Limitations

  • If Termux is closed in the background by Android, the cron service will stop updating your repository and you must open Termux again. Refer to instructions for your device model to disable the killing of certain background applications.
  • This may negatively affect your devices battery life. I'm not entirely sure yet.

Setup

@ph1048
ph1048 / IPA_Install_Apple_Silicon.md
Created July 17, 2023 05:34 — forked from Dids/IPA_Install_Apple_Silicon.md
Installing IPAs on the M1

Installing IPAs on Apple Silicon (M1)

  1. Open Apple Configurator 2 and plug in your iPhone or iPad
  2. Click Add, login to the App Store and select the application you want to install
  3. Open up ~/Library/Group\ Containers/K36BKF7T3D.group.com.apple.configurator/Library/Caches/Assets and wait until the TemporaryItems directory appears
  4. Copy the application from the newly created temporary directory, but do note that it will disappear once Apple Configurator is done installing
  5. Double click the .ipa on your Apple Silicon (M1) device and install it
  6. Fix permissions on the installed application by running sudo xattr -rd com.apple.quarantine /Applications/<your_app>.app (if you skip this step, you're unable to start the application)

Note that it's easier if you already have the application installed, as Apple Configurator will prompt you about overwriting the existing installation, at which point the temporary file (the .ipa) will still exist, until you choose an action in the prompt.

@ph1048
ph1048 / proxy.md
Created June 13, 2023 10:42 — forked from yougg/proxy.md
complete ways to set http/socks/ssh proxy environment variables

set http or socks proxy environment variables

# set http proxy
export http_proxy=http://PROXYHOST:PROXYPORT

# set http proxy with user and password
export http_proxy=http://USERNAME:PASSWORD@PROXYHOST:PROXYPORT

# set http proxy with user and password (with special characters)
@ph1048
ph1048 / Dockerfile
Created May 11, 2023 10:05 — forked from AverageMarcus/Dockerfile
Example multi-arch Dockerfile for Go projects
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.16 as builder
ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG TARGETOS
ARG TARGETARCH
WORKDIR /app/
ADD . .
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="-w -s" -o yourapplication main.go
@ph1048
ph1048 / usb-ether.sh
Created April 16, 2023 04:58 — forked from Cat-Lady/usb-ether.sh
Steam Deck USB Ethernet
#!/bin/sh
if [ "$UID" -ne 0 ]; then
echo "This script needs to be executed as root"
exit 1
fi
vendor_id="0x3000" # Valve
product_id="0x28DE"
serial_number="$(dmidecode -s system-serial-number)" # The Steam Deck's serial number
@ph1048
ph1048 / .zshrc
Last active April 25, 2023 11:44 — forked from Anon-Exploiter/.zshrc
.zshrc of Kali Linux 2020.3 including the lit prompt
# ~/.zshrc file for zsh non-login shells.
# see /usr/share/doc/zsh/examples/zshrc for examples
setopt autocd # change directory just by typing its name
#setopt correct # auto correct mistakes
setopt interactivecomments # allow comments in interactive mode
setopt ksharrays # arrays start at 0
setopt magicequalsubst # enable filename expansion for arguments of the form ‘anything=expression’
setopt nonomatch # hide error message if there is no match for the pattern
setopt notify # report the status of background jobs immediately
@ph1048
ph1048 / sources.list
Created January 2, 2022 16:16 — forked from josephlr/sources.list
/etc/apt/sources.list for Ubuntu Bionic 18.04
deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse
deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse
deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
deb [arch=amd64,i386] http://security.ubuntu.com/ubuntu bionic-security main restricted universe multiverse
deb [arch=arm64,armhf,ppc64el,s390x] http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe multiverse
deb [arch=arm64,armhf,ppc64el,s390x] http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe multiverse
deb [arch=arm64,armhf,ppc64el,s390x] http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted universe multiverse
deb [arch=arm64,armhf,ppc64el,s390x] http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse
@ph1048
ph1048 / google_photos_takeout_metadata_resolver.py
Created December 22, 2021 13:52 — forked from tetebueno/google_photos_takeout_metadata_resolver.py
Google Photos Takeout archive holds a JSON file with photo/video metadata, thing is that the naming for this JSON file is not always so obvious. This takes care of resolving the name with all the variants I found so far.
import re as _re
import json as _json
JSON_EXTENSION = '.json'
def find_json_for_file(file: Path):
try:
if file.with_name(file.name + JSON_EXTENSION).is_file():
# file.jpg -> file.jpg.json
the_json_path = file.with_name(file.name + JSON_EXTENSION)
@ph1048
ph1048 / enable_ebpf_on_wsl2
Created December 15, 2021 03:09 — forked from MarioHewardt/enable_ebpf_on_wsl2
Enable EBPF on WSL2
By default, EBPF programs will not run on WSL2 due to required kernel modules missing. The following example error is an
indication of this problem:
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.19.84-microso
ft-standard/modules.dep.bin'
modprobe: FATAL: Module kheaders not found in directory /lib/modules/4.19.84-microsoft-standard
chdir(/lib/modules/4.19.84-microsoft-standard/build): No such file or directory
To fix this you need to rebuild the WSL2 kernel with the missing kernel modules. The below instructions are for Ubuntu 18.04 WSL2.
1. git clone https://github.com/microsoft/WSL2-Linux-Kernel.git
@ph1048
ph1048 / mount_qcow2.md
Created August 22, 2021 13:01 — forked from shamil/mount_qcow2.md
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8