Skip to content

Instantly share code, notes, and snippets.

View blgnksy's full-sized avatar

Bilgin Aksoy blgnksy

  • METU
  • Berlin, Germany
View GitHub Profile
@blgnksy
blgnksy / ssh-keys.md
Last active June 16, 2022 13:46
Using SSH Keys instead of password

Using SSH Keys instead of password

  1. Create a ssh-key in host machine
ssh-keygen -f ~/.ssh/blgnksy-key-rsa -t rsa -b 4096
  1. Add key to ssh
ssh-add  ~/.ssh/blgnksy-key-rsa
'''
Adopted from https://stackoverflow.com/questions/19504350/how-to-convert-numbers-to-words-without-using-num2word-library for Turkish
'''
import re
ones = {
0: '', 1: 'bir', 2: 'iki', 3: 'üç', 4: 'dört', 5: 'beş', 6: 'altı',
7: 'yedi', 8: 'sekiz', 9: 'dokuz', 10: 'on', 11: 'onbir', 12: 'oniki',
@blgnksy
blgnksy / Timer.cpp
Last active December 6, 2020 17:48
#include <chrono>
#include <iostream>
#include <thread>
class Timer {
private:
std::chrono::time_point<std::chrono::high_resolution_clock> mStart;
public:
Timer() { mStart = std::chrono::high_resolution_clock::now(); }
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Exec=/path/to/executable
Name=Name of Application
Icon=/path/to/icon
# Store in ~/.local/share/applications
@blgnksy
blgnksy / ML_DL_DS.md
Last active October 21, 2020 11:36
Machine/Deep Learning

Torch

Describe Torch Tensors

def describe(x):     
  print("Type: {}".format(x.type()))     
  print("Shape/size: {}".format(x.shape))     
  print("Values: \n{}".format(x))
@blgnksy
blgnksy / Docker.md
Last active May 11, 2022 09:20
Docker

Docker

[TOC]

Adding users to Docker group

$ usermod -aG docker user_name

Dockerfile template

@blgnksy
blgnksy / WSL2.md
Last active October 16, 2020 07:32
Essentials for WSL2

WSL 2

Changing default distro

PS wslconfig /setdefault Ubuntu-18.04

Changing default user

PS ubuntu config --default-user username
@blgnksy
blgnksy / curl_example.cpp
Created November 18, 2019 17:47 — forked from alghanmi/curl_example.cpp
cURL C++ Example
#include <iostream>
#include <string>
#include <curl/curl.h>
static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp)
{
((std::string*)userp)->append((char*)contents, size * nmemb);
return size * nmemb;
}
@blgnksy
blgnksy / FFMPEG.md
Last active October 27, 2019 16:00

Crop frames from a video

-ss start pointer

-t end duration

ffmpeg -ss 00:03:08.000 -i _-AmJTHa0be6Q.mp4 -t 00:00:18.000  ./output/frame%07d.png
@blgnksy
blgnksy / PythonObfuscating.md
Created September 5, 2019 12:25
Python Obfuscating

Python Obfuscating

python -OO -m py_compile <your program.py>