Skip to content

Instantly share code, notes, and snippets.

View demofly's full-sized avatar

Stanislav O. demofly

View GitHub Profile
@demofly
demofly / get-k8s-node-ip-addresses.sh
Created March 22, 2018 22:02 — forked from rkuzsma/get-k8s-node-ip-addresses.sh
Get external IP address of Kubernetes nodes
#!/bin/bash
kubectl get nodes --selector=kubernetes.io/role!=master -o jsonpath={.items[*].status.addresses[?\(@.type==\"ExternalIP\"\)].address}
@demofly
demofly / bitbucket-pipelines.yml
Created February 21, 2018 20:11 — forked from adilsoncarvalho/bitbucket-pipelines.yml
Bitbucket Pipelines deployment to a Google Container Engine configuration
---
options:
docker: true
pipelines:
branches:
master:
- step:
script:
# Installing gcloud
@demofly
demofly / reclaimWindows10.ps1
Created January 7, 2018 20:00 — forked from alirobe/reclaimWindows10.ps1
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults)
##########
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <disassembler@dasm.cz>
# Modified by: alirobe <alirobe@alirobe.com> based on my personal preferences.
# Version: 2.10.1, 2017-11-25
# Primary Author Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
# Tweaked Source: https://gist.github.com/alirobe/7f3b34ad89a159e6daa1/
# Tweak difference:
#
# @alirobe's version is a subset focused on safely disabling telemetry, 'smart' features, and 3rd party bloat ...
@demofly
demofly / 20130416-todo.md
Created August 5, 2017 10:08 — forked from mrflip/20130416-todo.md
Elasticsearch Tuning Plan

Next Steps

  • Measure time spend on index, flush, refresh, merge, query, etc. (TD - done)
  • Take hot threads snapshots under read+write, read-only, write-only (TD - done)
  • Adjust refresh time to 10s (from 1s) and see how load changes (TD)
  • Measure time of a rolling restart doing disable_flush and disable_recovery (TD)
  • Specify routing on query -- make it choose same node for each shard each time (MD)
  • GC new generation size (TD)
  • Warmers
  • measure before/after of client query time with and without warmers (MD)
# Outbound UDP Flood protection in a user defined chain.
iptables -N udp-flood
iptables -A OUTPUT -p udp -j udp-flood
iptables -A udp-flood -p udp -m limit --limit 50/s -j RETURN
iptables -A udp-flood -j LOG --log-level 4 --log-prefix 'UDP-flood attempt: '
iptables -A udp-flood -j DROP
@demofly
demofly / remove_crw.cmd
Created December 26, 2015 23:13 — forked from xvitaly/remove_crw.cmd
Remove telemetry updates for Windows 7 and 8.1
echo Uninstalling KB3075249 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3075249 /quiet /norestart
echo Uninstalling KB3080149 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3080149 /quiet /norestart
echo Uninstalling KB3021917 (telemetry for Win7)
start /w wusa.exe /uninstall /kb:3021917 /quiet /norestart
echo Uninstalling KB3022345 (telemetry)
start /w wusa.exe /uninstall /kb:3022345 /quiet /norestart
echo Uninstalling KB3068708 (telemetry)
start /w wusa.exe /uninstall /kb:3068708 /quiet /norestart
@demofly
demofly / convert_ploop_to_simfs.sh
Last active September 9, 2015 11:30 — forked from dlage/convert_ploop_to_simfs.sh
Bash script to convert an OpenVZ ploop container back to simfs
#!/bin/sh
# ./convert_ploop_to_simfs.sh VEID
# chmod +x convert_ploop_to_simfs.sh
rsync_options='-aHv'
partition='vz'
if [ ! -e /etc/vz/conf/$1.conf ]; then
echo "Virtual server configuration file: /etc/vz/conf/$1.conf does not exist."
exit 1
fi
if [ ! -d /$partition/private/$1/root.hdd ]; then
@demofly
demofly / lsi.sh
Last active February 21, 2022 14:40
MegaCli wrapper for LSI MegaRAID for Debian/Ubuntu/RHEL/CentOS
#!/bin/bash
#
# originally came from Calomel.org
# https://calomel.org/megacli_lsi_commands.html
# LSI MegaRaid CLI
# lsi.sh @ Version 0.05
# Edited and optimized by demofly for rotational RAID arrays
#
# description: MegaCLI script to configure an Sound alarm disabled (server room too loud anyways)d monitor LSI raid cards.
@demofly
demofly / phantomjs
Last active October 15, 2023 14:45
Phantomjs startup script for Centos
#!/bin/sh
#
# chkconfig: - 35 99 99
# description: phantomjs zombo launchery
#
### BEGIN INIT INFO
# Provides: phantomjs
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
@demofly
demofly / set_irq_affinity.sh
Last active April 3, 2017 09:08 — forked from pavel-odintsov/irq_balance_habrahabr.sh
IRQ CPU affinity setter: network and RAID hardware
#!/bin/bash
ncpus=`grep -ciw ^processor /proc/cpuinfo`
test "$ncpus" -gt 1 || exit 1
n=0
for irq in `cat /proc/interrupts | grep 'IR-PCI-MSI-edge' | awk '{print $1}' | sed s/\://g`
do
f="/proc/irq/$irq/smp_affinity"
test -r "$f" || continue