Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
comp=$(echo $1 | awk -F'[/:]+' '{ sub("^github.com\.", "", $2); print $3 }')
repo=$(echo $1 | awk -F'[/:]+' '{ sub("^github.com\.", "", $2); print $4 }')
git clone $1 ${comp}_${repo}
@bohdantrotsenko
bohdantrotsenko / ct.go
Created November 25, 2020 10:13
A primitive cpu test
package main
import (
"fmt"
"log"
"runtime"
"time"
"golang.org/x/crypto/scrypt"
)
Firmware version 3.0.0.4.380_10446
- Release Note -
Bug fixes and enhancements:
- Fixed information disclosure vulnerability. Thanks to Haitan Xiang and Fand Wang.
- Fixed CVE-2018-5721 Stack-base buffer overflow vulnerability
- Fixed CVE-2018-8826 remote code code execution vulnerability. Thanks to Chris Wood.
- Fixed CVE-2018-5999 HTTP authorization bypass and CVE-2018-6000.
An independent security researcher has reported this vulnerability to Beyond Security’s SecuriTeam Secure Disclosure program
- Fixed remote code execution vulnerability. Thanks to David Maciejak of Fortinet's FortiGuard Labs
@bohdantrotsenko
bohdantrotsenko / sort.h
Created May 15, 2018 12:13
definition of sort() in #include <algorithm>
template <class _RandomAccessIterator>
inline _LIBCPP_INLINE_VISIBILITY
void
sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
{
_VSTD::sort(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
}
@bohdantrotsenko
bohdantrotsenko / heavy_cpu_goroutines_and_http_mux.go
Created August 17, 2016 13:57
Demonstrates that heavy cpu functions steal time from IO goroutines
package main
import (
"fmt"
"time"
"net/http"
"net"
)
const N = 300
package main
import (
"fmt"
"time"
)
const N = 300
const P = 20
const timeFormat = "15:04:05.0000"
using System;
using System.Diagnostics;
using System.Threading;
class Program
{
ManualResetEvent exit = new ManualResetEvent(false);
Thread[] ths;
int counter = 0;
package main
import (
"fmt"
"flag"
"sync"
"sync/atomic"
"time"
)