This file contains hidden or 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 'socket' | |
require 'thread' | |
socket = Socket.new Socket::AF_INET, Socket::SOCK_STREAM, Socket::IPPROTO_TCP | |
socket.setsockopt :SOCKET, :REUSEADDR, 1 | |
socket.bind Addrinfo.tcp('0.0.0.0', 31338) | |
socket.listen 0 | |
puts "Listen on 0.0.0.0 port 31338" |
This file contains hidden or 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
.section .text | |
.globl le32_to_be32 | |
.type le32_to_be32, @function | |
le32_to_be32: | |
pushl %ebp | |
movl %esp, %ebp | |
subl $0x14, %esp | |
pushl %ebx | |
pushl %ecx | |
pushl %edx |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"math" | |
"unsafe" | |
) | |
// IEEE-754 floating-point representation. | |
func ieee754BinRep(x float64) uint64 { |
This file contains hidden or 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
# this is an implementation of creating mad and stupid yet concurrent | |
# web server with only 65535 iteration before calling fork() syscall. | |
# | |
# fyi: this is pwn.college web server challenge | |
# | |
# Paulus Gandung Prakosa <[email protected]> | |
# | |
.section .rodata | |
.resp: |
This file contains hidden or 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
namespace foobar | |
module [ | |
ohm.encoding.json | |
ohm.util.io | |
ohm.lang.types.String | |
org.project.foo | |
org.project.bar | |
ohm.native.syscall | |
] |
This file contains hidden or 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
- Don't ask questions | |
- Don't take an interest in people outside of work | |
- Erase every trace | |
- Know when it's time to get out |
This file contains hidden or 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
# Full adder implementation | |
# Paulus Gandung Prakosa <[email protected]> | |
# ref: https://en.wikipedia.org/wiki/Adder_(electronics)#Full_adder | |
import math | |
import sys | |
def bit_count(x): | |
return x if x == 0 else math.floor(math.log2(x)) + 1 |
This file contains hidden or 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
# | |
# https://en.wikipedia.org/wiki/Two%27s_complement#Working_from_LSB_towards_MSB | |
# | |
# (c) 2022 Paulus Gandung Prakosa <[email protected]> | |
# | |
import sys | |
import math | |
num = int(sys.argv[1]) |
This file contains hidden or 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
// Routing approach using Regex Table method. | |
// 2022 (c) Paulus Gandung Prakosa <[email protected]> | |
package main | |
import ( | |
"fmt" | |
"log" | |
"regexp" | |
"sync" |
This file contains hidden or 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
'(?:(?:Rp)(?:\s*)(\d+)|(?:IDR)(?:\s*)(\d+)(?:\,(\d+))+(?:\.\d+)*|(?:Rp\.)(?:\s*)(\d+)(?:\.(\d+))+|(?:RP)(?:\s*)(\d+)(?:(?:\,)(\d+))+(?:\.\-)?|(\d+)((?:(?:\.)(?:\d+))+)(?:\,00)?)' |
NewerOlder