Skip to content

Instantly share code, notes, and snippets.

View jestan's full-sized avatar

Jestan Nirojan jestan

View GitHub Profile
@jasonrudolph
jasonrudolph / about.md
Last active May 14, 2024 16:36
Programming Achievements: How to Level Up as a Developer
@jestan
jestan / gist:1319504
Last active September 27, 2015 19:27
My Git Commands
#### Create a feature branch
git checkout -b <branch-name>
#### Create a remote branch for the feature branch
git push origin refs/heads/<branch-name>
#### Delete a remote branch
git push origin :refs/heads/<branch-name>
@jestan
jestan / wrapper.conf
Created December 19, 2011 12:41
Java Service Wrapper Properties
#wrapper.java.additional.1=-Xdebug
#wrapper.java.additional.2=-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
#wrapper.java.additional.1=-XX:+UseConcMarkSweepGC
#wrapper.java.additional.2=-Xloggc:logs/gclog
#wrapper.java.additional.3=-XX:MaxDirectMemorySize=256M
#wrapper.java.additional.4=-XX:NewRatio=1
@jestan
jestan / gist:1526653
Created December 28, 2011 06:11
Linux System Monitoring Commands
#monitor the hard disk utilization
iostat -xm 1
#monitor the cpu usage
sar -P ALL 1
#show disk usage
df -h
@viktorklang
viktorklang / Actor.java
Last active February 13, 2023 12:13
Minimalist Java Actors
/*
Copyright 2012-2021 Viktor Klang
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@jestan
jestan / about.md
Created May 2, 2012 16:57 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
@jboner
jboner / latency.txt
Last active July 17, 2024 03:12
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
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 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@santisaez
santisaez / gist:3187798
Created July 27, 2012 12:57
State of the Art: STUN + TURN servers on Linux (July 2012)

STUN implementations

  • stund
  • Content: server daemon and test client for STUN, RFC-3489 only
  • URL does not load, the project seems abandoned
  • The code is also available on SourceForge, last update was on January 2012
  • TCP and TLS modes not supported
  • The server needs two IPs, it’s mandatory and can not be configured
  • C++, no extra libraries required, Windows port available
  • Version = 0.97 (0.96 package available on Debian, 5 years without updates)
@alphazo
alphazo / gist:3303282
Created August 9, 2012 11:03
Clone MiFare cards using chinesse UUID writable cards

libnfc supports UUID writable cards and even has some dedicated tools for them.

However it doesn't work with some of the cards found on eBay that are even simpler to use. Sector 0 is unlocked and can be written without any additional commands. libnfc requires a small patch to get it working.

Following has been tested under ArchLinux with modified libnfc 1.5.1, mfoc 0.10.2 and a SCL3711 dongle.

Patch & recompile libnfc

The patch is fairly simple, open libnfc-1.5.1/utils/nfc-mfclassic.c and comment 2 lines (it was lines 384 and 385 for me):

// Try to write the trailer

@obscurerichard
obscurerichard / README.md
Created September 17, 2012 22:35
Simulates a low bandwidth, high-latency network connection

slow

This bash script offers quick shortcuts to simulate slower network connections. It is useful when you need to simulate a wireless network on a Linux network server, especially when you are using a virtual machine guest on your local machine or in the cloud.

slow 3G                   # Slow network on default eth0 down to 3G wireless speeds
slow reset                # Reset connection for default eth0 to normal
slow vsat --latency=500ms # Simulate satellite internet  with a high latency
slow dsl -b 1mbps         # Simulate DSL with a slower speed than the default

slow modem-56k -d eth0 # Simulate a 56k modem on the eth1 device. eth0 is unchanged.