Skip to content

Instantly share code, notes, and snippets.

View asuna's full-sized avatar
🏠
Working from home

asuna asuna

🏠
Working from home
View GitHub Profile
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@asuna
asuna / odi_keygen.py
Created January 11, 2023 15:49 — forked from rajkosto/odi_keygen.py
ODI SFP XPON stick MAC_KEY generator
#!/usr/bin/env python3
#ODI DFP-34X-2C2 MAC_KEY key generator by rajkosto
import sys
import string
import hashlib
args = sys.argv
if len(args) != 2:
sys.exit("Usage: odi_keygen.py YOURMACADDR")
@asuna
asuna / pvebackup.sh
Last active June 9, 2022 09:57
backup pve vms to local and cloud storage
#!/bin/bash
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
jobstatus=$1
vmid=$3
vmtype=${VMTYPE} # openvz/qemu
dumpdir=${DUMPDIR}
storeid=${STOREID}
vmname=${HOSTNAME}
tarfile=${TARFILE}
isolation.tools.getPtrLocation.disable = "TRUE"
isolation.tools.setPtrLocation.disable = "TRUE"
isolation.tools.setVersion.disable = "TRUE"
isolation.tools.getVersion.disable = "TRUE"
monitor_control.disable_directexec = "TRUE"
monitor_control.disable_chksimd = "TRUE"
monitor_control.disable_ntreloc = "TRUE"
monitor_control.disable_selfmod = "TRUE"
monitor_control.disable_reloc = "TRUE"
monitor_control.disable_btinout = "TRUE"
### Keybase proof
I hereby claim:
* I am asuna on github.
* I am yujizmq (https://keybase.io/yujizmq) on keybase.
* I have a public key ASDawhxCigczE8apD995wrofry-5IJpSE_LjkPXJZotB9Qo
To claim this, I am signing this object:
#/bin/bash
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
chain_exists()
{
[ $# -lt 1 -o $# -gt 2 ] && {
echo "Usage: chain_exists <chain_name> [table]" >&2
return 1
}
local chain_name="$1" ; shift
@asuna
asuna / cloudflare_update.script
Last active February 22, 2024 05:27 — forked from viritt/cloudflare_update.script
Automatic script for Mikrotik RouterOS updating record on CloudFlare.
#########################################################################
# ================================================== #
# $ Mikrotik RouterOS update script for CloudFlare $ #
# ================================================== #
# #
# - You need a CloudFlare account & api key (look under settings), #
# a zone and A record in it #
# - All variables in first section are obvious, except CFid, #
# To obtain CFzoneid use following command in any unix shell: #
# curl -X GET "https://api.cloudflare.com/client/v4/zones" -H "X-Auth-Email: YOUR_EMAIL" -H "X-Auth-Key: YOUR_API_KEY" -H "Content-Type: application/json" | python -mjson.tool
@asuna
asuna / java.env
Created April 25, 2018 02:02 — forked from rosstimson/java.env
Init Script (RHEL, CentOS) for ZooKeeper + optional configs (assumes zookeeper tarball extracted to /opt/zookeeper)
# /opt/zookeeper/conf/java.env
ZOO_LOG4J_PROP="INFO,ROLLINGFILE"
ZOO_LOG_DIR="/var/log/zookeeper/"

Keybase proof

I hereby claim:

  • I am asuna on github.
  • I am yujizmq (https://keybase.io/yujizmq) on keybase.
  • I have a public key ASAmXsVZCXLI2GZ_jMN-SjKWg2XiiCAbSxlCBXQFLFk9IQo

To claim this, I am signing this object:

@asuna
asuna / gist:7e70d1b0ffa91fbf46de4b1c41ce1e8b
Created March 15, 2018 07:41 — forked from Sinyshnar/gist:8574684
Proxmox USB install : no cdrom found
copy proxmox iso on usb stick
#fdisk -l
#mount /dev/sdb1 /mnt
#mount -o loop -t iso9660 /mnt/proxmox_1-7.iso /mnt
#cd /mnt
#chroot /mnt sbin/unconfigured.sh