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
// Link with -rdynamic | |
#include <execinfo.h> | |
#include <assert.h> | |
#include <stdio.h> | |
#include <assert.h> | |
#include <stdlib.h> | |
void bt() { | |
const size_t size = 100; |
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
rem Enable Win+L, Lock Windows, Disable Win+L. | |
rem Useful as a workaround to disable Win+L while being able to lock. | |
rem This makes sence if you are using Win+L for other purpose, for example, use Win+L inside a virtual Linux system. | |
rem Run this as Administrator. If it is annoying, try UAC Trust shortcut from www.itknowledge24.com | |
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableLockWorkstation /t REG_DWORD /d 0 /f | |
rundll32 user32.dll,LockWorkStation | |
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableLockWorkstation /t REG_DWORD /d 1 /f |
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
public class Hello { | |
public static void main(String args[]) { | |
System.out.println("hello world"); | |
} | |
} |
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 |
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
require 'rubygems/remote_fetcher' | |
require 'rubygems/user_interaction' | |
require 'rubygems/errors' | |
require 'rubygems/text' | |
## | |
# SpecFetcher handles metadata updates from remote gem repositories. | |
class Gem::SpecFetcher |
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
#include <cstdio> | |
#include <cinttypes> | |
#include <stdexcept> | |
#include <set> | |
union IPv4Addr { | |
struct { | |
uint32_t x; | |
uint8_t prefix; | |
}; |
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
#!/usr/bin/env ruby | |
# List latest china IPv4 list | |
require 'open-uri' | |
(ARGF.path == '-' ? open('http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest') : ARGF).lines.each do |l| | |
next if !l.include?('ipv4') || l.include?('*') | |
cc, type, start, value = l.split('|')[1, 4] |
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
require 'term/ansicolor' | |
require 'logger' | |
class String | |
include Term::ANSIColor | |
end | |
class ColorfulLogger < Logger | |
def initialize(logdev, shift_age = 0, shift_size = 1048576) |
NewerOlder