Skip to content

Instantly share code, notes, and snippets.

View ram0973's full-sized avatar
:octocat:
Thinking

ram0973 ram0973

:octocat:
Thinking
View GitHub Profile
@ram0973
ram0973 / krb5.conf
Created August 16, 2019 09:56 — forked from skokhanovskiy/krb5.conf
Example configuration files for libkrb5 and sssd for authentication with Active Directory
# This is an example of krb5.conf for authentication with Active Directory
# Tested on libkrb5-3 1.15-1+deb9u1
[libdefaults]
default_realm = EXAMPLE.COM
dns_lookup_realm = true
dns_lookup_kdc = true
forwardable = true
# Values for next three parameters should be used from Default Domain Policy GPO
@ram0973
ram0973 / mirrors.sh
Created May 21, 2019 12:37
Oneliner that select best (by download speed) mirror based on mirrors.ubuntu.com for yours ip.
curl -s http://mirrors.ubuntu.com/mirrors.txt | xargs -n1 -I {} sh -c 'echo `curl -r 0-102400 -s -w %{speed_download} -o /dev/null {}/ls-lR.gz` {}' |sort -g -r |head -1| awk '{ print $2 }'
@ram0973
ram0973 / unblock.ps1
Created April 30, 2019 08:09
Unblock files in current directory with PowerShell
Get-ChildItem -Path . -Recurse | Unblock-File
@ram0973
ram0973 / gist:9176e3b5a9fe94628017ad6d68b99dcc
Created April 18, 2019 10:33
Linux directories pretty yellow color in bash
export LS_COLORS="$LS_COLORS:di=1;33"
@ram0973
ram0973 / gist:8a1e0cdedcc9d86e18b3b81a741c76e9
Last active April 19, 2019 06:48
Another colored bash prompt
export PS1="SH \[\033[38;5;14m\]\u\[$(tput sgr0)\]\[\033[38;5;15m\]@\[$(tput sgr0)\]\[\033[38;5;11m\]\h\[$(tput sgr0)\]\[\033[38;5;15m\]:\[$(tput sgr0)\]\[\033[38;5;13m\]\w\[$(tput sgr0)\]\[\033[38;5;15m\]{\$?}\\$ \[$(tput sgr0)\]"
@ram0973
ram0973 / show last 5 numbers of Office 2016 key.ps1
Created April 15, 2019 14:08
Show last 5 numbers of Office 2016 key
cd "C:\Program Files (x86)\Microsoft Office\Office16"
cscript ospp.vbs /dstatus
@ram0973
ram0973 / wsl.ps1
Last active April 12, 2019 16:10
WSL setup in powershell
Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1804 -OutFile Ubuntu.appx -UseBasicParsing
Add-AppxPackage .\Ubuntu.appx
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
# restart Windows
ubuntu1804
@ram0973
ram0973 / gist:005936957c80422ba7cfa877a30de406
Created April 9, 2019 13:11
Forget to set name and email in git
git config --global --edit
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf > /dev/null
@ram0973
ram0973 / gist:540c5e05d158be6be71f8d2d7b7a8f40
Created February 4, 2019 13:30
Remove unused/hanged containers/images/nwetworks
# docker system prune
WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
- all dangling images
- all dangling build cache