Skip to content

Instantly share code, notes, and snippets.

View UlasSAYGINIM's full-sized avatar

Ulaş SAYGIN UlasSAYGINIM

View GitHub Profile
@denji
denji / golang-tls.md
Last active April 14, 2026 13:12 — forked from spikebike/client.go
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@cfstras
cfstras / -Build static versions of binutils, for example ld, gprof, nm, strip, objdump, ar, strings; with mingw or on *nix
Last active July 29, 2025 05:58
Build static versions of binutils, for example ld, gprof, nm, strip, objdump, ar, strings; with mingw or on *nix
See the bash script below. :)
Tested on debian bookworm-slim (`docker pull debian:bookworm-slim`).
### Prerequisites
```bash
apt update
apt install -y build-essential wget bison
```
@cypres
cypres / UIImageExt.swift
Created March 16, 2015 14:06
UIImage from UIImagePickerController resize + fix orientation
import UIKit
extension UIImage {
// Based on http://stackoverflow.com/a/1262395/449607
// Optimized for JPEG output
func imageResized(longEdge : CGFloat) -> UIImage {
func radians (degrees : Double) -> CGFloat {
return CGFloat(degrees * M_PI/180)
}
# uname -a
FreeBSD blynk.waitman.net 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r275492: Fri Dec 5 06:52:11 PST 2014 waitman@blynk.waitman.net:/usr/obj/usr/src/sys/BLYNK amd64
# usbconfig -d 0.5 dump_device_desc
ugen0.5: <CSR8510 A10 vendor 0x0a12> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)
bLength = 0x0012
bDescriptorType = 0x0001
@HappyCerberus
HappyCerberus / FastLineReader.cpp
Created March 31, 2015 11:53
Fast line-by-line file parser
#include "FastLineReader.h"
// POSIX
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
@mattsve
mattsve / setup.sh
Last active March 19, 2018 20:14
Freebsd
#!/bin/sh
# sysctls for jail needs to be
# allow.raw_sockets=true,allow.sysvipc=1
# Enable sshd
sed -i .bak 's/sshd_enable="NO"/sshd_enable="YES"/' /etc/rc.conf
rm /etc/rc.conf.bak
# Add sudo
pkg install sudo
@iamralch
iamralch / searchr.go
Created July 11, 2015 11:50
searchr - a sample application that works with pipes
package main
import (
"bufio"
"flag"
"fmt"
"io"
"os"
"strings"
)
@iamralch
iamralch / ssh_client.go
Last active September 10, 2025 02:55
SSH client in GO
package main
import (
"fmt"
"io"
"io/ioutil"
"net"
"os"
"strings"
@tokhi
tokhi / unixToolbox.md
Last active October 10, 2024 16:30
Collection of Unix/Linux/BSD commands and tasks which are useful for IT work or for advanced users.

#Unix Toolbox

This document is a collection of Unix/Linux/BSD commands and tasks which are useful for IT work or for advanced users. This is a practical guide with concise explanations, however the reader is supposed to know what s/he is doing.

##Unix Toolbox revision 14.4

The latest version of this document can be found at http://cb.vu/unixtoolbox.xhtml. Replace .xhtml on the link with .pdf for the PDF version and with .book.pdf for the booklet version. On a duplex printer the booklet will create a small book ready to bind. This XHTML page can be converted into a nice PDF document with a CSS3 compliant application (see the script example). See also the about page.
Error reports and comments are m
@joashp
joashp / openssl_encrypt_decrypt.php
Created September 4, 2015 15:59
Simple PHP encrypt and decrypt using OpenSSL
<?php
/**
* simple method to encrypt or decrypt a plain text string
* initialization vector(IV) has to be the same when encrypting and decrypting
*
* @param string $action: can be 'encrypt' or 'decrypt'
* @param string $string: string to encrypt or decrypt
*
* @return string
*/