Helper setup to edit .yaml files with Vim:
List of general purpose commands for Kubernetes management:
Helper setup to edit .yaml files with Vim:
List of general purpose commands for Kubernetes management:
Below are a set of best practices that I recommend for most customers. This information is based on my experience helping hundreds of Azure Redis customers investigate various issues.
-- show running queries (pre 9.2) | |
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(query_start, clock_timestamp()), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
from impacket import smb | |
from struct import pack | |
import sys | |
''' | |
PoC for trigger EternalBlue bug (BSOD) | |
Reference: | |
- http://blogs.360.cn/360safe/2017/04/17/nsa-eternalblue-smb/ | |
''' |
#!/usr/bin/env sh | |
## update.sh - manage a OpenWRT LetsEncrypt https instalation | |
# HOWTO: | |
# - put update.sh in its own directory (like /root/.https) | |
# - run ./update.sh your.domain.com (that domain needs to point to your router) | |
# * this get an issued cert from letsencrypt.org using the webroot verification method | |
# * also installs curl and ca-certificates packages | |
# - use crontab -e; add the line `0 0 * * * "/root/.https/update.sh" >>/root/.https/log.txt 2>&` | |
# * this runs the update every day, logging everything to log.txt | |
# |
# write-ups | |
## Resources | |
- [shell-storm](http://shell-storm.org/repo/) | |
## Tutorials | |
- [Codebashing](http://www.codebashing.com/) |
Latency Comparison Numbers | |
-------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns | |
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms | |
Read 4K randomly from SSD* 150,000 ns 0.15 ms |
#!/usr/bin/env ruby | |
require "date" | |
five_days_ago = Date.parse(Time.now.to_s) - 5 | |
IO.popen("hadoop fs -lsr /tmp").each_line do |line| | |
permissions,replication,user,group,size,mod_date,mod_time,path = *line.split(/\s+/) | |
if (mod_date) | |
if Date.parse(mod_date.to_s) < five_days_ago | |
puts line | |
if permissions.split('')[0] == 'd' |
$ ./bin/spark-shell | |
14/04/18 15:23:49 INFO spark.HttpServer: Starting HTTP Server | |
14/04/18 15:23:49 INFO server.Server: jetty-7.x.y-SNAPSHOT | |
14/04/18 15:23:49 INFO server.AbstractConnector: Started [email protected]:49861 | |
Welcome to | |
____ __ | |
/ __/__ ___ _____/ /__ | |
_\ \/ _ \/ _ `/ __/ '_/ | |
/___/ .__/\_,_/_/ /_/\_\ version 0.9.1 | |
/_/ |