Skip to content

Instantly share code, notes, and snippets.

@BrunIF
BrunIF / aws-ui-shorter-shortcuts.user.js
Last active January 14, 2020 23:01 — forked from jamesinc/aws-ui-shorter-shortcuts.user.js
A Tampermonkey script to replace various AWS console service names with acronyms, so they take up less space in the shortcuts bar.
// ==UserScript==
// @name AWS UI scrubber
// @namespace https://github.com/jamesinc
// @version 1.5
// @description Make AWS Console shortcuts take up less space
// @author James Ducker
// @match https://*.console.aws.amazon.com/*
// @match https://phd.aws.amazon.com/*
// @grant none
// @run-at document-end
@BrunIF
BrunIF / .bash_aliases
Created November 5, 2019 13:40 — forked from vratiu/.bash_aliases
Git shell coloring
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset
@BrunIF
BrunIF / network-restart.sh
Created October 29, 2019 13:19 — forked from tachang/network-restart.sh
Cleanly restart the default libvirt network
#!/bin/bash
#
# Yury V. Zaytsev <[email protected]> (C) 2011
#
# This work is herewith placed in public domain.
#
# Use this script to cleanly restart the default libvirt network after its
# definition have been changed (e.g. added new static MAC+IP mappings) in order
# for the changes to take effect. Restarting the network alone, however, causes
# the guests to lose connectivity with the host until their network interfaces
@BrunIF
BrunIF / PHP EV,EVENT, LIBEVENT - Ubuntu 17.10.txt
Created July 11, 2019 06:34 — forked from Mecanik/PHP EV,EVENT, LIBEVENT - Ubuntu 17.10.txt
Install PHP EV, EVENT, LIBEVENT on Ubuntu 17.10 for PHP 7.1 (FPM, CLI)
Please use with caution, if you do not understand what these extensions are for, then document yourself first.
PHP LIBEVENT
WARNING: CAUSES SEGEMENTATION FAULT ON PHP 7.0 !
------------------------------------------
cd /usr/src/
git clone https://github.com/expressif/pecl-event-libevent.git
cd pecl-event-libevent
phpize
./configure
@BrunIF
BrunIF / mysql-docker.sh
Created July 11, 2019 06:32 — forked from nshtg/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root -pPASSWORD DATABASE > backup.sql
docker exec CONTAINER /usr/bin/mysqldump -u root -pPASSWORD DATABASE | gzip > backup.sql.gz
docker exec CONTAINER /usr/bin/mysqldump -u root -pPASSWORD DATABASE | bzip2 > backup.sql.bz2
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root -pPASSWORD DATABASE
gunzip < backup.sql.gz | docker exec -i CONTAINER /usr/bin/mysql -u root -pPASSWORD DATABASE
bunzip2 < backup.sql.bz2 | docker exec -i CONTAINER /usr/bin/mysql -u root -pPASSWORD DATABASE
@BrunIF
BrunIF / network-tweak.md
Created June 5, 2019 14:17 — forked from mustafaturan/network-tweak.md
Linux Network Tweak for 2 million web socket connections

Sample config for 2 million web socket connection

    sysctl -w fs.file-max=12000500
    sysctl -w fs.nr_open=20000500
    # Set the maximum number of open file descriptors
    ulimit -n 20000000

    # Set the memory size for TCP with minimum, default and maximum thresholds 
 sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'
@BrunIF
BrunIF / install-quake3.sh
Created February 21, 2019 10:26 — forked from simonewebdesign/install-quake3.sh
Install Quake 3: Arena on a mac
#!/bin/bash
# Install Quake 3: Arena on a mac
# Copyright (c) 2016 simonewebdesign
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
@BrunIF
BrunIF / backup.sh
Created February 8, 2019 14:26 — forked from nherment/backup.sh
Backup and restore an Elastic search index (shamelessly copied from http://tech.superhappykittymeow.com/?p=296)
#!/bin/bash
# herein we backup our indexes! this script should run at like 6pm or something, after logstash
# rotates to a new ES index and theres no new data coming in to the old one. we grab metadatas,
# compress the data files, create a restore script, and push it all up to S3.
TODAY=`date +"%Y.%m.%d"`
INDEXNAME="logstash-$TODAY" # this had better match the index name in ES
INDEXDIR="/usr/local/elasticsearch/data/logstash/nodes/0/indices/"
BACKUPCMD="/usr/local/backupTools/s3cmd --config=/usr/local/backupTools/s3cfg put"
BACKUPDIR="/mnt/es-backups/"
YEARMONTH=`date +"%Y-%m"`
@BrunIF
BrunIF / mac-cheat-sheet.md
Created November 23, 2018 17:48 — forked from michaellihs/mac-cheat-sheet.md
Mac OS Cheat Sheet

Mac Cheat Sheet

This Gist contains a collection of resources and snippets for the administration of your Mac.

System Tweaks

  • Disable Boot Chime