This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cocoa | |
import AudioToolbox | |
import CoreAudio | |
let fileType = kAudioFileAIFFType; | |
let sampleRate = 44100.0; | |
var pcm = AudioStreamBasicDescription(mSampleRate: sampleRate, | |
mFormatID: kAudioFormatLinearPCM, | |
mFormatFlags: kAudioFormatFlagIsBigEndian | kAudioFormatFlagIsSignedInteger, | |
mBytesPerPacket: 2, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import java.io.OutputStream; | |
import java.net.InetSocketAddress; | |
import com.sun.net.httpserver.HttpExchange; | |
import com.sun.net.httpserver.HttpHandler; | |
import com.sun.net.httpserver.HttpServer; | |
public class SimpleServer { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta charset="utf-8"> | |
</head> | |
<style> | |
.peak-line { | |
fill: none; | |
stroke-width: 1; | |
stroke: red; | |
stroke-dasharray: 2,2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
</head> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.min.js"></script> | |
<body> | |
<canvas id="myChart"></canvas> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set number | |
set nohlsearch | |
let mapleader="/" | |
"Mappings | |
noremap <Leader>ev :e $MYVIMRC<cr> | |
nnoremap <Leader>sv :source $MYVIMRC<cr> | |
inoremap jk <esc> | |
noremap <Leader>n :setlocal number!<cr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Will resize the image given in the first parameter | |
# to 100x100, 200x200, and 300x300 with | |
# respective filenames @1x, @2x, @3x | |
NAME=$(echo "$1" | cut -d'.' -f1) | |
EXTENSION=$(echo "$1" | cut -d'.' -f2) | |
sips -z 100 100 $1 --out ../$NAME@1x.$EXTENSION | |
sips -z 200 200 $1 --out ../$NAME@2x.$EXTENSION | |
sips -z 300 300 $1 --out ../$NAME@3x.$EXTENSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SHELL=/bin/sh | |
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | |
*/15 * * * * speedtest --csv >> speedtests.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
snmptrap -v 2c -c public localhost '' 1.3.6.1.4.1.8072.2.3.0.1 1.3.6.1.4.1.8072.2.3.2.1 i 123456 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List them all | |
sudo iptables -v -t nat -L -n --line-numbers | |
# Create one in the nat table | |
sudo iptables -t nat -A POSTROUTING --source 172.17.0.3 --destination 172.17.0.3 -p udp -j MASQUERADE | |
# Delete one in the nat table | |
sudo iptables -t nat -D POSTROUTING 12 | |
sudo iptables -t nat -D DOCKER 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tcpdump -i eno1 -T snmp -n dst portrange 161-162 | |
# output looks like this for an ios router linkup | |
# 11:47:50.905818 IP 10.10.201.27.56503 > 10.10.202.11.162: V2Trap(138) .1.3.6.1.2.1.1.3.0=791308 .1.3.6.1.6.3.1.1.4.1.0=.1.3.6.1.6.3.1.1.5.4 .1.3.6.1.2.1.2.2.1.1.1=1 .1.3.6.1.2.1.2.2.1.2.1="FastEthernet0/0" .1.3.6.1.2.1.2.2.1.3.1=6 .1.3.6.1.4.1.9.2.2.1.1.20.1="up" | |
# in ios you can see how many snmp traps, the address its sending to and the port | |
# router4#show snmp | |
# Chassis: FTX151202SZ | |
# 0 SNMP packets input | |
# 0 Bad SNMP version errors | |
# 0 Unknown community name |
NewerOlder