Let's assume we have a pod called nginx
running in the namespace nginx-test
.
kubectl create namespace nginx-test
kubectl run nginx --image=nginx -n nginx-test
## Netcat server command | |
nc -l <unused port # > /dev/null | |
eg: | |
nc -l 1122 > /dev/null | |
## Netcat Client command | |
dd if=/dev/zero bs=9100004096 count=1 | nc <netcat server> <netcat port> | |
eg: | |
dd if=/dev/zero bs=9100004096 count=1 | nc 10.0.1.251 1122 |
//... | |
async getToken() { | |
let fcmToken = await AsyncStorage.getItem('fcmToken'); | |
if (!fcmToken) { | |
fcmToken = await firebase.messaging().getToken(); | |
if (fcmToken) { | |
await AsyncStorage.setItem('fcmToken', fcmToken); | |
} | |
} | |
} |
const crypto = require('crypto'); | |
function createSha256CspHash(content) { | |
return 'sha256-' + crypto.createHash('sha256').update(content).digest('base64'); | |
} |
#!/bin/sh | |
# by: "John Hazelwood" <jhazelwo@users.noreply.github.com> | |
# | |
# iptables rules to only allow VPN traffic AND let user SSH to VPN server itself. | |
# Use this on a CentOS/RedHat server you have set up to be a NAT firewall for your network. | |
# This will force ALL Internet traffic to go over the VPN | |
# and will BLOCK ALL Internet TRAFFIC if VPN is not running! | |
# | |
# use `service iptables save` to save the rules to /etc/sysconfig/iptables | |
# made |
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use Time::HiRes; | |
my $reporting_interval = 5.0; # seconds | |
my $bytes_this_interval = 0; | |
my $start_time = [Time::HiRes::gettimeofday()]; | |
STDOUT->autoflush(1); |
############################################################################ | |
# # | |
# ------- Useful Docker Aliases -------- # | |
# # | |
# # Installation : # | |
# copy/paste these lines into your .bashrc or .zshrc file or just # | |
# type the following in your current shell to try it out: # | |
# wget -O - https://gist.githubusercontent.com/jgrodziski/9ed4a17709baad10dbcd4530b60dfcbb/raw/d84ef1741c59e7ab07fb055a70df1830584c6c18/docker-aliases.sh | bash | |
# # | |
# # Usage: # |
#!/usr/bin/env bash | |
# set -x | |
if [[ $EUID -ne 0 ]]; then | |
echo "You must be root to run this script" | |
exit 1 | |
fi | |
# Returns all available interfaces, except "lo" and "veth*". |
from flask import Flask, Response | |
app = Flask(__name__) | |
@app.route("/wav") | |
def streamwav(): | |
def generate(): | |
with open("signals/song.wav", "rb") as fwav: | |
data = fwav.read(1024) |
# 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 |