Skip to content

Instantly share code, notes, and snippets.

View zentavr's full-sized avatar

Andrii Miroshnychenko zentavr

  • Zaporizhzhia, Ukraine
View GitHub Profile
global computerIsInUse, resetTime
on run
set computerIsInUse to true
set resetTime to (do shell script "date +%s") as integer
end run
on idle
set idleTime to (do shell script "ioreg -c IOHIDSystem | awk '/HIDIdleTime/ {print $NF; exit}'") as integer
if idleTime is greater than 7.4E+10 then
@yoctozepto
yoctozepto / ansible#22579 workaround.yml
Last active February 1, 2021 09:02
ansible#22579 workaround
---
### For details see https://github.com/ansible/ansible/issues/22579
### BEFORE
---
- name: Check freezer containers
become: true
@maxried
maxried / README.md
Created January 17, 2020 14:46
Wireguard in initrd

These scripts allow you to have a wireguard connection in your initrd. Make sure you have wireguard installed on your system and a busybox which supports ip, nslookup. If it does not work, change the copy_exec line for busybox in the hook and replace it with a better one. It reads /etc/wireguard/initramdisk.conf and expects at least one comment specifying all ip addresses like so: # Address = 1.2.3.4/12. Tested on Ubuntu 19.10.

@zajdee
zajdee / debian-initramfs-ipv6-hook-script
Last active February 20, 2024 13:51
Scripts to support IPv6 networking in Debian pre-boot (initramfs) environment
#!/bin/sh
# Script to be placed in /etc/initramfs-tools/hooks/ipv6
PREREQ=""
prereqs()
{
echo "$PREREQ"
}
@gatopeich
gatopeich / minecraft@.service
Created April 8, 2019 22:08
Systemd service for Minecraft Bedrock server (MCMrARM's mcpelauncher-server)
# /etc/systemd/system/minecraft@.service by gatopeich
#########
# HowTo #
#########
#
# - Copy this file to /etc/systemd/system/minecraft@.service
#
# - adduser --system --shell /bin/bash --home /opt/mcpe --group minecraft
#
@sanchezzzhak
sanchezzzhak / clickhouse-get-tables-size.sql
Created January 18, 2018 13:43
clickhouse get tables size
SELECT table,
formatReadableSize(sum(bytes)) as size,
min(min_date) as min_date,
max(max_date) as max_date
FROM system.parts
WHERE active
GROUP BY table
@zparnold
zparnold / one_liner.sh
Last active April 25, 2024 21:56
A simply script to delete all failed pods from Kubernetes
kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
@SamuelDudley
SamuelDudley / StrongSwan_build_notes.txt
Last active July 25, 2019 17:24
StrongSwan vici python usage snippet
# install notes for ubuntu 14.04 / odroid xu4
sudo apt-get install libgmp3-dev
# dont apt-get StrongSwan! (its really old)
wget https://download.strongswan.org/strongswan-5.5.1.tar.bz2
tar xvfj strongswan-5.5.1.tar.bz2
cd strongswan-5.5.1
sudo ./configure --prefix=/usr --sysconfdir=/etc --enable-python-eggs --enable-python-eggs-install --enable-vici
sudo make
sudo make install
@graphis
graphis / simpleMLB.sh
Created September 14, 2016 18:13 — forked from al3xtjames/simpleMLB.sh
Simple Main Logic Board (MLB) Serial Generator Script
#!/bin/bash
#
# Simple Main Logic Board (MLB) Serial Generator Script by TheRacerMaster
# Based off the work of Hanger1, AGuyWhoIsBored & Alien:X
# NOTE: This is a simple script that doesn't do any checking of other SMBIOS values. It needs valid SMBIOS data which includes the following:
# - Valid SmUUID value in Clover config.plist under SMBIOS (generated using uuidgen)
# - ROM value set to UseMacAddr0 in Clover config.plist (uses MAC address of your first NIC as ROM value)
# - Properly formatted serial number (doesn't have to be a real one, just formatted properly) in Clover config.plist under SMBIOS
# - Don't use a generic serial number (such as Clover's default)! It needs to be at least semi-unique.
# - Try using a generated serial number that isn't real (but formatted correctly) from Clover Configurator, Chameleon Wizard, etc.
@EmmanuelKasper
EmmanuelKasper / gist:f24cc7088b206ea0ec87
Last active January 4, 2024 10:40
Proxmox Text Terminal Howto

Map a virtual serial port on the guest(ttyS0) to a pseudo terminal(pty) on the host This has to be added to /etc/pve/qemu-server/VMID.conf:

args: -device isa-serial,chardev=myChardevice,id=s -chardev pty,id=myChardevice

After starting the VM check you will see a message:

char device redirected to /dev/pts/7 (label myChardevice)

Inside the guest, you should see now the serial port: