This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Connect to a Virtual Box serial port pipe | |
# 1. Enable Virtual Box serial port 1 as "Host Pipe", untick "Connect to | |
# existing", enter path, e.g "/tmp/apollo" | |
# 2. Start VM, SSH in and enable terminal and reboot: | |
# systemctl enable serial-getty@ttyS0.service | |
# 3. Connect to port with this script, pass the filename | |
# 4. Disconnect with escape key Ctrl+O (letter not zero) | |
if [ $# -ne 1 ]; then echo "Usage: $0 PIPE"; exit 1; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Compact ext3/4 filesystems in a VM | |
# Tools should all be available within a gparted live VM | |
# Enable discard support in VirtualBox with a command like: | |
# vboxmanage storageattach "GParted Live" --storagectl=VirtIO --port=0 --discard=on --nonrotational=on | |
# Or disable the fstrim and use | |
# vbox-img.exe compact --filename DISK.vdi | |
set -eux | |
for DEV in $(lsblk -o name,fstype --raw --paths | grep 'ext[34]' | cut '-d ' -f1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void enable_ac(void) | |
{ | |
__asm__("pushf\n" | |
"orl $0x40000, (%rsp)\n" | |
"popf"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=FPing LAN | |
After=network.target auditd.service time-sync.target | |
[Service] | |
ExecStart=/usr/bin/fping \ | |
--loop --period=1000 --timeout=500 --squiet=1800 \ | |
192.168.0.1 \ | |
192.168.0.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button id="uncheckAll">Uncheck All</button> | |
<script type="text/javascript"> | |
$('#uncheckAll').click(function(){$('.inline-task-list li.checked').each(function(i,e){ev = jQuery.Event("click"); ev.target = ev. currentTarget = e; ev.offsetX = ev.offsetY = 10; $(e).trigger(ev);});}); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Rules] | |
*.debug=true | |
qt.*.debug=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cvlc "$1" \ | |
--sout='#udp{dst=239.1.1.170:1234}' \ | |
--no-sout-rtp-sap \ | |
--no-sout-standard-sap \ | |
--sout-all --ttl=1 --sout-keep --loop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for ID in $(vboxmanage list hdds | grep '^UUID:' | cut -c14-) | |
do | |
vboxmanage modifyhd $ID --compact | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Enable very strict flags for some files to ensure compatibility with | |
# all compilers (enables C99 strict compliance mode and more warnings). | |
STRICTFLAGS := \ | |
-D_XOPEN_SOURCE --std=c99 -pedantic-errors -W -Wall -Wextra \ | |
-Wno-variadic-macros -Wno-overlength-strings -fdiagnostics-show-option | |
STRICTFLAGS_FILES := \ | |
file_a.c \ | |
file_b.c | |
# Use '=' not ':=' to create a makefile macro |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PGPORT=5678 | |
APP_PID=$(pidof -s $1) | |
if [ $? -ne "0" ] | |
then | |
echo "Can not find PID of $1" | |
exit 1 | |
fi |
NewerOlder