Skip to content

Instantly share code, notes, and snippets.

@yzdann
yzdann / .tmux.conf
Last active November 27, 2020 14:08
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'pwittchen/tmux-plugin-spotify'
#
set-option -g default-shell /bin/zsh
unbind C-b
set -g prefix C-a
@yzdann
yzdann / generate_data.sh
Created April 20, 2019 11:28
A simple SHA256 hashing example, written in Python using hashlib
#!/bin/bash
# Generates ten data files, each 300 MB in size and filled with random data.
[[ ! -d "data/" ]] && mkdir "data/"
for i in {1..10}; do
dd if="/dev/random" of="data/file${i}" bs=1m count=300
done

Operational PGP

This is a guide on how to email securely.

There are many guides on how to install and use PGP to encrypt email. This is not one of them. This is a guide on secure communication using email with PGP encryption. If you are not familiar with PGP, please read another guide first. If you are comfortable using PGP to encrypt and decrypt emails, this guide will raise your security to the next level.

@yzdann
yzdann / .vimrc
Last active June 10, 2019 12:18
" commentry Plugin
:set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" vundle
Plugin 'VundleVim/Vundle.vim'
" theme
Plugin 'liuchengxu/space-vim-dark'
" nerd tree and tagbar
@yzdann
yzdann / KeyMappings
Created January 26, 2019 14:32 — forked from rubyonrailsworks/KeyMappings
NerdTree
o.......Open files, directories and bookmarks....................|NERDTree-o|
go......Open selected file, but leave cursor in the NERDTree.....|NERDTree-go|
t.......Open selected node/bookmark in a new tab.................|NERDTree-t|
T.......Same as 't' but keep the focus on the current tab........|NERDTree-T|
i.......Open selected file in a split window.....................|NERDTree-i|
gi......Same as i, but leave the cursor on the NERDTree..........|NERDTree-gi|
s.......Open selected file in a new vsplit.......................|NERDTree-s|
gs......Same as s, but leave the cursor on the NERDTree..........|NERDTree-gs|
O.......Recursively open the selected directory..................|NERDTree-O|
x.......Close the current nodes parent...........................|NERDTree-x|
import serial
# set dev path
dev_path = ''
baudrate = 9600
ser = serial.Serial(dev_path, baudrate, timeout=0)
ser.flushInput()
ser.flushOutput()
import serial
import time
# set dev path
dev_path = ''
baudrate = 9600
ser = serial.Serial(dev_path, baudrate, timeout=0)
ser.flushInput()
ser.flushOutput()
@yzdann
yzdann / rsa.py
Created January 23, 2019 17:04
fun with crypto lib in python
from Crypto.PublicKey import RSA
from Crypto import Random
import ast
def newkeys(keysize):
random_generator = Random.new().read
key = RSA.generate(keysize, random_generator)
private, public = key, key.publickey()
return public, private
@yzdann
yzdann / pipenv_cheat_sheet.md
Created January 21, 2019 20:16 — forked from bradtraversy/pipenv_cheat_sheet.md
Pipenv cheat sheet for common commands

Pipenv Cheat Sheet

Install pipenv

pip3 install pipenv

Activate

pipenv shell
زن یا مرد بودن یارو ؟
چه درسی رو از همه بدتر درس می‌ده یا بهتر درس می‌ده؟
تگ برای این‌که به بگیم چرا بده؟
گیر به حضور غیاب بد نمره بده یا هرچی دیگه