Skip to content

Instantly share code, notes, and snippets.

jaseywang jaseywang

Block or report user

Report or block jaseywang

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@thanksdanny
thanksdanny / LC_CTYPE.txt
Created Dec 27, 2016 — forked from jampajeen/LC_CTYPE.txt
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
View LC_CTYPE.txt
vi /etc/environment
add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
@vasanthk
vasanthk / System Design.md
Last active Jun 27, 2019
System Design Cheatsheet
View System Design.md

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
View axure-pro-7.0-license-key.txt
Axure RP 7.0注册码
用户名:axureuser
序列号:8wFfIX7a8hHq6yAy6T8zCz5R0NBKeVxo9IKu+kgKh79FL6IyPD6lK7G6+tqEV4LG
View Java Code - Url Shortener.java
package testjava;
import java.util.HashMap;
import java.util.Random;
/*
* URL Shortener
*/
public class URLShortener {
// storage for generated keys
@asiegman
asiegman / nginx.conf
Created Jan 29, 2015
nginx logstash output
View nginx.conf
# Output json-esque output for logstash to parse easily.
http {
# ...
log_format logstash_json '{"@timestamp": "$time_iso8601", '
'"remote_addr": "$remote_addr", '
'"remote_user": "$remote_user", '
'"body_bytes_sent": "$body_bytes_sent", '
'"request_time": "$request_time", '
@sh1n0b1
sh1n0b1 / ssltest.py
Created Apr 8, 2014
Python Heartbleed (CVE-2014-0160) Proof of Concept
View ssltest.py
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
@thomasfr
thomasfr / iptables.sh
Last active Jun 22, 2019
iptable rules to allow outgoing DNS lookups, outgoing icmp (ping) requests, outgoing connections to configured package servers, outgoing connections to all ips on port 22, all incoming connections to port 22, 80 and 443 and everything on localhost
View iptables.sh
#!/bin/bash
IPT="/sbin/iptables"
# Server IP
SERVER_IP="$(ip addr show eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}')"
# Your DNS servers you use: cat /etc/resolv.conf
DNS_SERVER="8.8.4.4 8.8.8.8"
# Allow connections to this package servers
@jaseywang
jaseywang / nexus 752
Created Jan 16, 2014
nexus 752 step by step
View nexus 752
1. 7004_A
开启特性
feature vpc
feature lacp
no ip domain-lookup
建立 VRF 与 peer-keepalive,将建立的 peer-keepalive 成员端口加入到 VRF 中,与 7004 的路由表隔离
interface mgmt0
vrf member management
ip address 10.1.1.1/24
@Fluidbyte
Fluidbyte / expecting.md
Last active May 18, 2019
Basic principles of using tcl-expect scripts
View expecting.md

Intro

TCL-Expect scripts are an amazingly easy way to script out laborious tasks in the shell when you need to be interactive with the console. Think of them as a "macro" or way to programmaticly step through a process you would run by hand. They are similar to shell scripts but utilize the .tcl extension and a different #! call.

Setup Your Script

The first step, similar to writing a bash script, is to tell the script what it's executing under. For expect we use the following:

#!/usr/bin/expect
View cpu l1, l2, l3 cache
# dmidecode -t cache
# dmidecode 2.9
SMBIOS 2.6 present.
Handle 0x0700, DMI type 7, 19 bytes
Cache Information
Socket Designation: Not Specified
Configuration: Enabled, Not Socketed, Level 1
Operational Mode: Write Back
Location: Internal
You can’t perform that action at this time.