Skip to content

Instantly share code, notes, and snippets.

View spellancer's full-sized avatar

Sarkis Nanyan spellancer

  • Russian Federation
View GitHub Profile
@spellancer
spellancer / gist:2426450
Created April 20, 2012 05:55
laba 5 finish Assembly
; Template for console application
.586
.MODEL flat , c
OPTION CASEMAP:NONE
.CONST
MsgExit DB 13,10,"Press Enter to Exit",0AH,0DH,0
;Задание
;Вариант 11.
@jboner
jboner / latency.txt
Last active July 27, 2024 12:32
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
fin = open("input.xml", "r")
a = fin.readline()
l = ""
kk = False
while len(a)!=0:
a = fin.readline()
if a.find("<kernel>")!=-1 and kk==False:
p = a.find("<kernel>")
for i in range(0,p):
l+= " "
@rindeal
rindeal / interrupts_stats.sh
Last active July 26, 2018 13:49
Pretty print /proc/interrupts
#!/bin/sh
sed -r -e 's/^ *//' -e 's/ {2,}/|/g' < /proc/interrupts | \
awk -F'|' '
BEGIN { cpu_n = 0; }
NR == 1 {
for(i = 1; i <= NF; i++)
if($i ~ CPU)
cpu_n++;
}
@moloch--
moloch-- / Makefile
Last active April 26, 2023 00:55
Basic cross-platform reverse shell in Go
EXE = shell
SRC = .
LDFLAGS = -ldflags="-s -w"
windows:
GOOS=windows go build -o $(EXE)_win.exe $(LDFLAGS) $(SRC)
macos:
GOOS=darwin go build -o $(EXE)_macos $(LDFLAGS) $(SRC)
@bgadrian
bgadrian / set.go
Last active June 4, 2024 16:29
How to implement a simple set data structure in golang
type Set struct {
list map[int]struct{} //empty structs occupy 0 memory
}
func (s *Set) Has(v int) bool {
_, ok := s.list[v]
return ok
}