Skip to content

Instantly share code, notes, and snippets.

View dungvn3000's full-sized avatar

Nguyen Duc Dung dungvn3000

View GitHub Profile
@pryorda
pryorda / ceph.conf.txt
Last active October 17, 2020 06:55
Ceph BlueStore Config Options
root@prod-ceph-node5:~# cat /etc/ceph/ceph.conf |egrep -i '(blue|read)'
bluestore default buffered read = true
osd disk threads = 12
filestore op threads = 12
bluestore compression mode = none
bluestore min alloc size ssd = 4096
bluestore min alloc size hdd = 4096
root@prod-ceph-node5:~#
@yellowbyte
yellowbyte / dynamic_loading.c
Last active March 25, 2023 13:14
example of using dlopen and dlsym to dynamically resolve call to `puts`. String reference to `puts` is also obfuscated.
// how to compile: gcc dynamic_loading.c -o dynamic_loading -ldl
#include <stdlib.h>
#include <stdio.h>
#include <dlfcn.h>
#include <string.h>
int main(int argc, char **argv) {
void *handle;
void (*go)(char *);
@voluntas
voluntas / sysctl.conf
Created October 14, 2017 13:07 — forked from techgaun/sysctl.conf
Sysctl configuration for high performance
### KERNEL TUNING ###
# Increase size of file handles and inode cache
fs.file-max = 2097152
# Do less swapping
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
@tscholl2
tscholl2 / aes.go
Last active March 29, 2024 11:06
simple AES encryption/decryption example with PBKDF2 key derivation in Go, Javascript, and Python
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"encoding/hex"
"fmt"
"strings"
@fxkraus
fxkraus / debian-install-megacli.md
Last active March 10, 2024 10:20
Install LSI MegaCli .deb package on Debian/Ubuntu

download

wget https://docs.broadcom.com/docs-and-downloads/raid-controllers/raid-controllers-common-files/8-07-14_MegaCLI.zip

unzip

unzip 8-07-14_MegaCLI.zip
@naoto-ogawa
naoto-ogawa / MyLog02.hs
Created May 24, 2017 13:27
a small sample (the smallest ?) of MonadLogger
{-
a small sample (the smallest ?) of MonadLogger
-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings #-}
module MonadLoggerSample where
import Control.Monad.Logger
import monix.eval.Task
import java.util.concurrent.TimeUnit
import scala.concurrent.duration._
/** Request limiter for APIs that have quotas per second, minute, hour, etc.
*
* {{{
* // Rate-limits to 100 requests per second
* val limiter = TaskLimiter(TimeUnit.SECONDS, limit = 100)
*
@paresy
paresy / gist:3cbd4c6a469511ac7479aa0e7c42fea7
Last active December 21, 2022 01:43
PHP Embed Example
#include <stdio.h>
#include <iostream>
#include <thread>
#include <list>
#include <sapi/embed/php_embed.h>
int main(int argc, char* argv[]) {
int threadCount = 5;
package shade.local
import shade.local.ImmutableCache.{Timestamp, Value}
import scala.annotation.tailrec
import scala.collection.immutable.SortedMap
import scala.concurrent.duration._
/** Describes an immutable cache data-structure.
*
* It behaves much like a standard `scala.collection.immutable.Map`, but
@gagarine
gagarine / install-clamav-osx.md
Last active June 7, 2023 07:54
Howto Install clamav on OSX with brew

Howto Install clamav on OSX with brew

Note: on legacy intel system the path may be /usr/local/etc/clamav instead of /opt/homebrew/etc/clamav/

$ brew install clamav
$ cd /opt/homebrew/etc/clamav/
$ cp freshclam.conf.sample freshclam.conf