Skip to content

Instantly share code, notes, and snippets.

View Kyshman's full-sized avatar

Kysh Kyshman

  • Bush N Blooms
  • Kenya
  • 21:12 (UTC +03:00)
  • X @kyshman
View GitHub Profile
@Kyshman
Kyshman / transfer.sh.ps1
Created March 16, 2024 14:26 — forked from r4dian/transfer.sh.ps1
Upload to transfer.sh from Powershell
function transfer ($filename)
{
$file = Get-Item $filename;
invoke-webrequest -method put -infile $file.FullName https://transfer.sh
}
"Test" | Set-Content .\test.txt
transfer(".\test.txt")
@Kyshman
Kyshman / tunnelbroker-net.sh
Created May 16, 2023 06:07 — forked from pklaus/tunnelbroker-net.sh
tunnelbroker.net automatic tunnel IP update and tunnel setup (on Mac OS X)
#!/bin/bash
#### This script is published by Philipp Klaus <philipp.l.klaus@web.de>
#### on <http://blog.philippklaus.de/2011/05/ipv6-6in4-tunnel-via-hurricane-electric-tunnelbroker-net-automatic-ip-update-on-mac-os-x/>
#### It is originally by freese60 and modified by limemonkey.
#### Found on <http://www.tunnelbroker.net/forums/index.php?topic=287.0>
### Uncomment this line to debug the script:
#set -x

openpgp4fpr:C75E5171524765A2C4D8A4113A73F55BE2FDDE73

@Kyshman
Kyshman / rclone_sync.txt
Created May 6, 2022 11:25 — forked from muety/rclone_sync.txt
Automated Google Drive sync for Linux using rclone
Script that will trigger a local to remote sync when any changes below your local Google Drive folder occur - but at max. every 10 minutes - and a remote to local sync every x (e.g. 30 minutes) via a cron job.
0. Install rclone and configure it for Google Drive
1. Create files listed below
2. Configure rclone_watch_local.sh to be run on startup (e.g. using a systemd service unit)
3. Add a cron job that runs rclone_remote2local.sh every x (e.g. 30) minutes
----------------------
rclone_local2remote.sh
----------------------
@Kyshman
Kyshman / WiFi_Static_Debian.md
Last active March 14, 2022 17:43
Automatic WiFi Static & DHCP Settings on Startup

Adding Static Wi-Fi IP address on Ubuntu/Debian and derivaties

  • Begin by Hex encoding your wifi details
sudo wpa_passphrase "Your Wifi Network SSID"  "Your Wifi WPA/WPA2 password"

Output:

network={
@Kyshman
Kyshman / Qemu-KVM-shrink+compress.MD
Created August 31, 2021 06:25 — forked from nimbosa/Qemu-KVM-shrink+compress.MD
shrink + compress virtual disk image in Qemu/KVM

shrink + compress virtual disk image in Qemu/KVM

originally from Martin Kopta's blog

Tue Apr 22 10:41:10 UTC 2014

In order to shrink virtual disk of your virtual machine (process called disk space reclamation) in Qemu/KVM, you can go with following. In your running virtual machine, fill all remaining empty space with zeroes. Then, shut down virtual machine and convert the disk image from original format to the same format (esentially doing nothing). In the process of conversion, Qemu will skip the zeroes and save you some space. You can even add some compression to save even more space.

root@vm# dd if=/dev/zero of=/file
root@vm# rm /file
@Kyshman
Kyshman / Correct_GnuPG_Permission.sh
Created August 10, 2021 14:09 — forked from wongsyrone/Correct_GnuPG_Permission.sh
This fixes the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error while using Gnupg .
#!/usr/bin/env bash
# To fix the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error
# Make sure that the .gnupg directory and its contents is accessibile by your user.
chown -R $(whoami) ~/.gnupg/
# Also correct the permissions and access rights on the directory
chmod 600 ~/.gnupg/*
chmod 700 ~/.gnupg
If your ISP is using PPPoE, lets set it up in your OpenWrt. Tested with DLink DIR-300(Rev.A) with OpenWrt Backfire 10.03.1.
Edit /etc/config/network. Under “WAN” section, set the configuration with:
config 'interface' 'wan'
option 'ifname' 'eth0.2'
option 'proto' 'pppoe'
option 'username' 'your-own-username'
option 'password' 'your-own-password'
option 'defaultroute' '1'
option 'peerdns' '1'
### Keybase proof
I hereby claim:
* I am kyshman on github.
* I am kysh (https://keybase.io/kysh) on keybase.
* I have a public key ASBlFlpGYVvJxgyIzulH_nSPav4_ih6F9l4dIZ7DXrmzdwo
To claim this, I am signing this object: