This file contains hidden or 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
ssh-keygen && cat $env:userprofile/.ssh/id_rsa.pub | ssh user@linuxserver 'cat >> .ssh/authorized_keys' |
This file contains hidden or 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
# After upgrading Parallels Desktop, often, this command (used by the packer parallels driver): | |
# mdfind kMDItemCFBundleIdentifier == com.parallels.desktop.console | |
# will return not only one path, but a list of the old one(s) and the one: | |
# /opt/homebrew-cask/Caskroom/parallels-desktop/11.0.2-31348/Parallels Desktop.app | |
# /opt/homebrew-cask/Caskroom/parallels-desktop/11.1.0-32202/Parallels Desktop.app | |
# | |
# Maybe one day the packer team will fix their code and use only the highest version in that list, | |
# Until then we have to fix the list by ourselves: | |
mdfind kMDItemCFBundleIdentifier == com.parallels.desktop.console |
This file contains hidden or 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
# to enable this filter add to jail.conf following (/etc/fail2ban/jail.conf) | |
# Thanks to -> TheBarret | |
[nginx-4xx] | |
enabled = true | |
port = http,https | |
logpath = /var/log/nginx/access.log | |
maxretry = 3 |
This file contains hidden or 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
set ignorecase | |
set smartcase | |
set scrolloff=3 " 3 lines above/below cursor when scrolling | |
" Emulated Plugins | |
set surround | |
" Copy to system clipboard as well | |
set clipboard+=unnamed |
This file contains hidden or 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
# kudos to dzaku at consolechars.wordpress.com | |
### MOUNT qcow2 image with lvm partitions | |
# ensure nbd can handle that many partitions | |
sudo modprobe nbd max_part=8 | |
# present image as block device through NBD | |
sudo qemu-nbd --connect=/dev/nbd0 <image.qcow2> |
This file contains hidden or 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
!xrdb ~/.Xresources | |
!xterm font and locale | |
xterm.locale:true | |
xterm.utf8: true | |
xterm*utf8Title:true | |
xterm*fontMenu*fontdefault*Label:Default | |
xterm*faceName:Menlo:antialias=true:pixelsize=13 | |
xterm*faceNameDoublesize:WenQuanYi Micro Hei Mono:pixelsize=13:antialias=true |
This file contains hidden or 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
#define _XOPEN_SOURCE 500 /* Enable certain library functions (strdup) on linux. See feature_test_macros(7) */ | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <limits.h> | |
#include <string.h> | |
struct entry_s { | |
char *key; | |
char *value; |
This file contains hidden or 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
#include <stdio.h> | |
#include <string.h> | |
#include <pulse/pulseaudio.h> | |
// Field list is here: http://0pointer.de/lennart/projects/pulseaudio/doxygen/structpa__sink__info.html | |
typedef struct pa_devicelist { | |
uint8_t initialized; | |
char name[512]; | |
uint32_t index; | |
char description[256]; |
This file contains hidden or 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 | |
PROGNAME=$(basename $0) | |
VERSION="1.0.0" | |
usage() { | |
echo "Usage: $PROGNAME [OPTIONS] [FILE]" | |
echo " This script is ~." | |
echo | |
echo "Options:" |