Skip to content

Instantly share code, notes, and snippets.

View kolargol's full-sized avatar

Zbyszek Żółkiewski kolargol

View GitHub Profile
@kolargol
kolargol / ip-setup-eni.sh
Last active July 2, 2018 08:27
AWS EC2: setup high number of outgoing (persistent) connections from single instance (4 ENI) - 4 million connections
#!/bin/bash
# Juan Pablo and Zbyszek Zolkiewski (at) ProcessOne 2015-2018
#
# This script configures additional 3 ENI (+1 aliased eth0) on AWS ec2
# Following setup allow to generate around 4 milion outgoing connections from single instance
# If one need more, you need to add additional ENI and allocate max 15 IP per ENI (AWS limit)
# RPS:
# echo ff > /sys/class/net/eth0/queues/rx-0/rps_cpus
@kolargol
kolargol / encrypt_maildir.sh
Last active November 5, 2024 01:56
Encrypts old mails for Dovecot mail-crypt-plugin
#!/usr/local/bin/bash
#
# Encrypt/Decrypt/Check emails with Dovecot's mail-crpyt-plugin
# This script will encrypt/decrypt emails in-place
# Please read: https://wiki.dovecot.org/Design/Dcrypt and https://wiki2.dovecot.org/Plugins/MailCrypt
#
# Update variables with your keys and patch otherwise you will loose data!
#
# I take no responsibility for data loos this script may cause
#
@kolargol
kolargol / update-route53.sh
Created September 28, 2015 18:04 — forked from phybros/update-route53.sh
BASH Script to keep Route53 updated with your current external IP address
#!/bin/bash
# Hosted Zone ID e.g. BJBK35SKMM9OE
ZONEID="enter zone id here"
# The CNAME you want to update e.g. hello.example.com
RECORDSET="enter cname here"
# More advanced options below
# The Time-To-Live of this recordset
@kolargol
kolargol / ip_scan_bl.sh
Last active May 11, 2022 18:29
bash script that detect iphone proximity and takes actions when it arrives/leave range. This example terminate all SSH sessions on server where it is running when iPhone leave range.
#!/bin/bash
# Script that detects arrival,presence,departure of iPhone based on bluetooth. It also execute actions
# In this script it terminate SSH sessions when defined device lefts range
# Requires: bluetooth, hcitools, curl
# Written by Zbyszek Żółkiewski, please visit: http://blog.onefellow.com
# Install:
# - copy ip_scan.sh to /usr/local/bin/ on your local machine/server
# - chmod ugo+x /usr/local/bin/ip_scan.sh
# - change 'ip_iphone' variable to point you your iPhone mac-address
#!/bin/bash
# Script that detects arrival,presence,departure of iPhone on local network
# Requires arp-scan tool
# Written by Zbyszek Żółkiewski, please visit: http://blog.onefellow.com
# Install:
# - copy ip_scan.sh to /usr/local/bin/
# - chmod ugo+x /usr/local/bin/ip_scan.sh
# - change 'ip_iphone' variable to point you your iPhone IP
# - option: insert your boxcar_id otherwise comment-out boxcar_send function in action_after_grace
# - put into cron: echo "*/1 * * * * root /usr/local/bin/ip_scan.sh" > /etc/cron.d/iphone_scan , or whatever user you want

Keybase proof

I hereby claim:

  • I am kolargol on github.
  • I am zbyszek (https://keybase.io/zbyszek) on keybase.
  • I have a public key whose fingerprint is B6D7 1B54 DD8C A9D6 13BE EFF8 E834 13E7 9DB6 2E31

To claim this, I am signing this object:

#!/bin/bash
# Notify by Boxcar
# http://www.process-one.net
usage() {
echo -e "\nUsage: $0 -a AccessToken -t MessageTitle -d MessageDetails -s SoundID"
echo -e "Example: -$0 -a LuckJewacat6 -t \"Some message\" -d \"Message details\" -s 21\n"
exit 1;