Skip to content

Instantly share code, notes, and snippets.

View alexamiryan's full-sized avatar

Alex Amiryan alexamiryan

View GitHub Profile

~/.profile

if [[ "$(umask)" = "0000" ]]; then
    umask 0022
fi

~/.bashrc

if [ -z "$(pgrep ssh-agent)" ]; then
@alexamiryan
alexamiryan / wsl_git_sign.md
Created August 20, 2020 21:37
Howto make git signing work on WSL

Add

export GPG_TTY=$(tty)

to .bashrc

@alexamiryan
alexamiryan / pixel_update.md
Last active October 24, 2020 18:48
Pixel manual update and root instructions
  • Download latest image from Google Factory images page
  • Extract archive
  • Extract image-coral-xxxxx.zip
  • Open Power Shell
  • > adb reboot bootloader
  • Edit flash-all.bat and remove -w flag from last fastboot command
  • > .\flash-all.bat
  • Wait until system is flashed and rebooted, wait for a successful boot
  • Copy boot.img file from image archive to the phone
  • Open Magisk Manager -> Install -> Install -> Select and Patch a File. Select the boot.img
@alexamiryan
alexamiryan / git-clean-branches
Created August 19, 2020 00:07
Git extension to clean up both local and remote stale branches
#!/bin/bash
current_branch=$(git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')
if [ "$current_branch" != "master" ]; then
echo "WARNING: You are on branch $current_branch, NOT master."
fi
echo -e "Fetching merged branches...\n"
git remote update --prune
remote_branches=$(git branch -r --merged | grep -v '/master$' | grep -v "/$current_branch$")
@alexamiryan
alexamiryan / .gitconfig
Created August 19, 2020 00:03
My .gitconfig
[user]
name = Name Surname
email = email@example.com
[alias]
ad = add .
ci = commit
co = checkout
br = branch
pl = pull
ps = push
### Keybase proof
I hereby claim:
* I am alexamiryan on github.
* I am alexamiryan (https://keybase.io/alexamiryan) on keybase.
* I have a public key ASCbaxaM7GRoNUOkA_YbaONKgwnRLHuqYhqB7rxjgXkJ3wo
To claim this, I am signing this object:
yum install broadcom-wl kmod-wl
mdadm --detail --scan >> /etc/mdadm.conf
@alexamiryan
alexamiryan / create_cert.sh
Created January 19, 2010 15:51
Create SSL certificate
#!/bin/sh
openssl genrsa -out client.key 1024
openssl req -new -key client.key -out client.csr
openssl x509 -req -days 365 -CA ca.crt -CAkey ca.key -CAcreateserial -in client.csr -out client.crt
openssl pkcs12 -export -clcerts -in client.crt -inkey client.key -out client.p12
rm -f client.crt client.csr client.key
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]