Skip to content

Instantly share code, notes, and snippets.

View roustem's full-sized avatar

Roustem Karimov roustem

View GitHub Profile
# Export GPG key to `key.asc` file and then import
gpg --import key.asc
# or add --pinentry-mode if there is ap problem with entering the password
# gpg --import --pinentry-mode loopback key.asc
git config --global commit.gpgsign true
git config --global user.signingkey E25C1E01F3A98447
git config --global gpg.program /usr/bin/gpg
git config --global user.email roustem@1password.com
@roustem
roustem / i3-cheat-sheet.md
Created February 2, 2020 17:21 — forked from JeffPaine/i3-cheat-sheet.md
i3 Window Manager Cheat Sheet

i3 Window Manager Cheat Sheet

$mod refers to the modifier key (alt by default)

General

  • startx i3 start i3 from command line
  • $mod+<Enter> open a terminal
  • $mod+d open dmenu (text based program launcher)
  • $mod+r resize mode ( or to leave resize mode)
  • $mod+shift+e exit i3
@roustem
roustem / .bashrc
Created September 27, 2019 02:32 — forked from gsomoza/.bashrc
SSH Agent in Windows (Git Bash / MinGW)
#!bash.exe
export SSH_AUTH_SOCK=/tmp/.ssh-socket
echo ;
echo Starting connection with ssh-agent...
ssh-add -l 2>&1 >/dev/null
if [ $? = 2 ]; then
rm -f /tmp/.ssh-script /tmp/.ssh-agent-pid /tmp/.ssh-socket
# Exit status 2 means couldn't connect to ssh-agent; start one now
echo Creating new ssh-agent...
ssh-agent -a $SSH_AUTH_SOCK > /tmp/.ssh-script
@roustem
roustem / tasks.json
Created August 18, 2019 17:52 — forked from JunSuzukiJapan/tasks.json
VS Code tasks.json for Rust/Cargo
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "cargo build",
"group": {
@roustem
roustem / use-touch-id-for-sudo.md
Last active January 7, 2021 17:55
Use TouchID for sudo

Use TouchID for sudo

sudo vi /etc/pam.d/sudo
# add first line:
auth       sufficient     pam_tid.so
function x(name) {
console.log(">x: ", name);
return new Promise(function (resolve, reject) {
setTimeout(() => {
console.log("<x: ", name);
resolve(name);
}, 5000);
});
}
// grep - Search stdin or some files for lines matching a given string.
use std::error::Error;
use std::io::{self, BufReader};
use std::io::prelude::*;
use std::fs::File;
use std::path::PathBuf;
fn grep<R>(target: &str, reader: R) -> io::Result<()>
where R: BufRead
@roustem
roustem / macOS-mojave-iso.sh
Created March 31, 2019 19:32 — forked from jamieparfet/macOS-mojave-iso.sh
Create an ISO from the mojave installer app
#!/bin/bash
# This assumes that the ~6GB mojave installer is in the /Applications folder.
# If it's not, just open the App Store, search Mojave, and you can download the installer file from there.
hdiutil create -o /tmp/mojave.cdr -size 6g -layout SPUD -fs HFS+J
hdiutil attach /tmp/mojave.cdr.dmg -noverify -mountpoint /Volumes/install_mojave
sudo /Applications/Install\ macOS\ mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/install_mojave
mv /tmp/mojave.cdr.dmg ~/Desktop/InstallSystem.dmg
hdiutil detach /Volumes/Install\ macOS\ mojave
@roustem
roustem / Setting-up-Windows-WSL1.md
Last active February 25, 2024 07:12
Setting-up-Windows-WSL1
package main
import (
"sync/atomic"
"testing"
)
var id uint64
const chanLength = 100