Skip to content

Instantly share code, notes, and snippets.

View ozanh's full-sized avatar

Ozan Hacıbekiroğlu ozanh

View GitHub Profile
/*
dump-pagemap.c - Dump pagemap entries associated with mappings of a given process
Copyright 2021 Hilko Bengen <bengen@hilluzination.de>
License: GPL3 or later
Based on information from:
- linux/Documentation/filesystems/proc.txt
- linux/Documentation/admin-guide/mm/pagemap.rst
*/
@thrawn01
thrawn01 / main.go
Created December 3, 2018 20:34
etcd `concurrency.Election` example with connection interruption detection and initial leadership status reporting
package main
import (
"context"
"fmt"
"os"
"os/signal"
"syscall"
"time"
@asukakenji
asukakenji / 0-go-os-arch.md
Last active July 26, 2024 08:44
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
@caiguanhao
caiguanhao / CryptoJS-AES.md
Last active November 29, 2023 06:37
CryptoJS AES encryption/decryption JavaScript and command line examples

You can run these commands to encrypt or decrypt a string:

Command

To encrypt:

printf "Lorem ipsum dolor sit amet, ..." | \
  openssl enc -e -base64 -A -pbkdf2 -aes-256-cbc -pass pass:"my-password"

-e: Encrypt data

@naholyr
naholyr / _service.md
Created December 13, 2012 09:39
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@spikebike
spikebike / client.go
Created March 29, 2012 01:13
TLS server and client
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"log"
)
@glennblock
glennblock / fork forced sync
Created March 4, 2012 19:27
Force your forked repo to be the same as upstream.
git fetch upstream
git reset --hard upstream/master