Skip to content

Instantly share code, notes, and snippets.

Petr Michalec epcim

Block or report user

Report or block epcim

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@epcim
epcim / gist:eac5083ae1ea5e8dc0e862d9dfa28fbd
Created Mar 12, 2019 — forked from mattm7n/gist:1405067
Monitor DHCP traffic with tcpdump
View gist:eac5083ae1ea5e8dc0e862d9dfa28fbd
# Monitoring on interface eth0
tcpdump -i eth0 -n port 67 and port 68
@epcim
epcim / gist:da40504103f2390f76ebcee4fe48e226
Created Mar 3, 2019 — forked from pwnsdx/gist:d127873e24cef159d4d603accaf37ee4
Uninstall XQuartz.app from OSX Yosemite/El Capitan/Sierra
View gist:da40504103f2390f76ebcee4fe48e226
launchctl unload /Library/LaunchAgents/org.macosforge.xquartz.startx.plist && \
sudo launchctl unload /Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist && \
sudo rm -rf /opt/X11* /Library/Launch*/org.macosforge.xquartz.* /Applications/Utilities/XQuartz.app /etc/*paths.d/*XQuartz && \
sudo pkgutil --forget org.macosforge.xquartz.pkg && \
rm -rf ~/.serverauth* && rm -rf ~/.Xauthorit* && rm -rf ~/.cache && rm -rf ~/.rnd && \
rm -rf ~/Library/Caches/org.macosforge.xquartz.X11 && rm -rf ~/Library/Logs/X11
View bash_jobs_wait.sh
# wait for background jobs
while true; do
wait -n || {
code="$?"
([[ $code = "127" ]] && exit 0 || exit "$code")
break
}
done;
@epcim
epcim / vimrc
Created Feb 4, 2019 — forked from jonmorehouse/vimrc
UUID generator for vim. Inputs a uuid to copy buffer
View vimrc
fu! GenerateUUID()
python << EOF
import uuid
import vim
# output a uuid to the vim variable for insertion below
vim.command("let generatedUUID = \"%s\"" % str(uuid.uuid4()))
EOF
@epcim
epcim / dhcpd.conf
Created Jan 16, 2019 — forked from robinsmidsrod/dhcpd.conf
Trying to chainload iPXE with full feature set from a lesser featured one, whilst still being able to boot non-supported cards with UNDI
View dhcpd.conf
ddns-update-style none;
deny bootp; #default
authoritative;
include "/etc/dhcp/ipxe-option-space.conf";
# GREEN (private network)
subnet 10.1.1.0 netmask 255.255.255.0 {
range 10.1.1.100 10.1.1.199;
option subnet-mask 255.255.255.0;
@epcim
epcim / _INSTALL.md
Created Jan 16, 2019 — forked from robinsmidsrod/_INSTALL.md
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)
View _INSTALL.md

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

@epcim
epcim / etcd.sh
Created Jan 8, 2019
etcd operations
View etcd.sh
etcdctl --endpoints https://master-0:2379 --ca-file /etc/kubernetes/secrets/etcd-client-ca.crt --cert-file /etc/kubernetes/secrets/etcd-client.crt --key-file /etc/kubernetes/secrets/etcd-client.key cluster-health
ETCDCTL_API=3 etcdctl --endpoints https://master-0:2379 --cacert /etc/kubernetes/secrets/etcd-client-ca.crt --cert /etc/kubernetes/secrets/etcd-client.crt --key /etc/kubernetes/secrets/etcd-client.key endpoint health
ETCDCTL_API=3 etcdctl --endpoints https://master-0:2379 --cacert /etc/kubernetes/secrets/etcd-client-ca.crt --cert /etc/kubernetes/secrets/etcd-client.crt --key /etc/kubernetes/secrets/etcd-client.key get --keys-only --prefix /registry
View libvirt_kvm.rst

Using Libvirt and KVM

Installation

Install required packages
apt-get install qemu-kvm libvirt-bin bridge-utils virtinst
@epcim
epcim / setup_git_diff_like_a_pro.md
Last active Nov 28, 2018
vimdiff diff dirdiff git
View setup_git_diff_like_a_pro.md
You can’t perform that action at this time.