Skip to content

Instantly share code, notes, and snippets.

View lukesUbuntu's full-sized avatar
🚀
code all day every day & code in my sleep..... zzzz

Luke Hardiman lukesUbuntu

🚀
code all day every day & code in my sleep..... zzzz
View GitHub Profile
#!/bin/sh
set -eufo pipefail
if [ "$#" -ne 2 ]; then
echo "usage: $0 source_repo_url target_repo_url" >&2
exit 1
fi
SOURCE_URL="$1"
#!/bin/bash
#Original: http://www.hyenacloud.com/blog/?p=327
#Modified by Neoon
/sbin/iptables -D INPUT -m set --match-set blacklist src -j DROP
/sbin/ipset create blacklist hash:net hashsize 10000000 maxelem 200000
/sbin/iptables -I INPUT -m set --match-set blacklist src -j DROP
IP_TMP=/tmp/ip.tmp
IP_BLACKLIST=/root/ip-blacklist.conf
IP_BLACKLIST_TMP=/tmp/ip-blacklist.tmp
@midnightcodr
midnightcodr / main.js
Created December 9, 2017 18:06
node-fetch with retry
const fetch = require('node-fetch')
const delay = (ms) => {
return new Promise(resolve => {
setTimeout(() => {
resolve()
}, ms)
})
}
const retryFetch = (url, fetchOptions={}, retries=3, retryDelay=1000) => {
@spilth
spilth / android-emulator-homebrew.sh
Last active November 14, 2022 17:44
Android Emulator with Homebrew
touch ~/.android/repositories.cfg
brew cask install caskroom/versions/java8
brew cask install android-sdk
brew cask install intel-haxm
brew install qt
export ANDROID_SDK_ROOT="/usr/local/share/android-sdk"
sdkmanager "platform-tools" "platforms;android-27" "extras;intel;Hardware_Accelerated_Execution_Manager" "build-tools;27.0.0" "system-images;android-27;google_apis;x86" "emulator"
avdmanager create avd -n test -k "system-images;android-27;google_apis;x86"
/usr/local/share/android-sdk/tools/emulator -avd test
@plutocrat
plutocrat / ssl-check-report.sh
Last active February 24, 2024 14:23
Bash Script to check SSL expiry dates and send a report
#!/bin/bash
# Requires openssl, bc, grep, sed, date, mutt, sort
## Edit these ##
# Space separated list of domains to check
DOMAINLIST="hp.com github.com google.com"
# Where to send the report
REPORTEMAIL=me@example.com
# Additional alert warning prepended if domain has less than this number of days before expiry
EXPIRYALERTDAYS=15
@khorsmann
khorsmann / kipimi0-100-cpu
Created July 20, 2017 14:31 — forked from maxp/kipimi0-100-cpu
kipmi0 100% CPU workaround
echo 100 > "/sys/module/ipmi_si/parameters/kipmid_max_busy_us"
@ziadoz
ziadoz / install.sh
Last active April 20, 2024 10:18
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# https://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# https://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# https://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# https://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE`
@sayem314
sayem314 / mem.sh
Created September 30, 2016 14:06
processs memory check on linux
#!/bin/bash
ps -C $1 -O rss | awk '{ count ++; sum += $2 }; END {count --; print "Number of processes =",count; print "Memory usage per process =",sum/1024/count, "MB"; print "Total memory usage =", sum/1024, "MB" ;};'
@RabbitMC
RabbitMC / Sentry-Install-Ubuntu-16-04
Last active February 24, 2023 06:01
Setup sentry on Ubuntu 16.04 server
# Project: https://github.com/getsentry/sentry
# Doc: https://docs.getsentry.com/on-premise/server/installation/python/
udo apt-get update
sudo apt-get install python-virtualenv
sudo apt-get install python-setuptools
sudo apt-get install python-pip
sudo apt-get install libxslt1-dev
sudo apt-get install gcc
@daronco
daronco / letsencrypt-webroot-apache.md
Last active February 15, 2024 11:50
Letsencrypt with webroot on Apache

Config Apache with /etc/apache2/conf-available/le.conf:

Alias /.well-known/acme-challenge/ "/var/www/html/.well-known/acme-challenge/"
<Directory "/var/www/html/">
    AllowOverride None
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    Require method GET POST OPTIONS
</Directory>