Skip to content

Instantly share code, notes, and snippets.

View nobu-sh's full-sized avatar
🏓
Pong! 20ms

Nobu nobu-sh

🏓
Pong! 20ms
  • East Moline, Illinois
  • 02:30 (UTC -05:00)
View GitHub Profile
@WebSofter
WebSofter / ecosystem.config.json
Created October 28, 2019 13:47
Run laravel artisian serve script via pm2
{
"apps": [{
"name": "laravel-app",
"script": "artisan",
"args": ["serve", "--host=0.0.0.0", "--port=3333"],
"instances": "1",
"wait_ready": true,
"autorestart": false,
"max_restarts": 1,
"interpreter" : "php",
@lmlsna
lmlsna / iptables-whitelist-cloudflare.sh
Created November 27, 2017 18:30
A Bash one-liner to whitelist Cloudflare's IPs in iptables.
#!/bin/bash
iptables -A INPUT -p tcp -m multiport --dports 80,443 -s $(for ip in $(curl -s https://www.cloudflare.com/ips-v4); do echo -n "$ip,"; done|head -c-1) -j ACCEPT
ip6tables -A INPUT -p tcp -m multiport --dports 80,443 -s $(for ip in $(curl -s https://www.cloudflare.com/ips-v6); do echo -n "$ip,"; done|head -c-1) -j ACCEPT
@JamieMason
JamieMason / is_installed.sh
Last active February 17, 2024 10:12
Check if a program exists from a bash script.Thanks to twitter.com/joshnesbitt and twitter.com/mheap for the help with detecting npm packages.
#!/bin/bash
# Functions ==============================================
# return 1 if global command line program installed, else 0
# example
# echo "node: $(program_is_installed node)"
function program_is_installed {
# set to 1 initially
local return_=1