Skip to content

Instantly share code, notes, and snippets.

View maateen's full-sized avatar
:octocat:
Alive & Breathing!

Maksudur Rahman Maateen maateen

:octocat:
Alive & Breathing!
View GitHub Profile
Add this to your ~/.bashrc:
if [ ! -S ~/.ssh/ssh_auth_sock ]; then
eval `ssh-agent`
ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock
fi
export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock
ssh-add -l | grep "The agent has no identities" && ssh-add
Source: http://unix.stackexchange.com/a/217223/109606
@maateen
maateen / cellular-tax-calc.py
Created August 30, 2016 10:58
This will take a float number as input and show the total number with tax. (Bangladesh)
#/usr/bin/python3
print("Press 'Ctrl+C' to exit this tool.")
try:
while True:
print("\nPlease input price in BDT: ")
a = float(input())
b=a+((a*5)/100)
c=b+((b*15)/100)
d=c+((a*1)/100)
@maateen
maateen / TLP config file
Last active October 18, 2020 13:22
All TLP settings are stored in the config file /etc/default/tlp. The default configuration provides optimized power saving out of the box. Some advanced features like turning off the optical drive and battery thresholds need to be activated explicitly. The config file can be changed with any text editor (root privilege is needed). For more: http…
# ------------------------------------------------------------------------------
# tlp - Parameters for power save
# See full explanation: http://linrunner.de/en/tlp/docs/tlp-configuration.html
# Hint: some features are disabled by default, remove the leading # to enable
# them.
# Set to 0 to disable, 1 to enable TLP.
TLP_ENABLE=1
@maateen
maateen / bashrc
Created September 21, 2016 17:24
if [ ! -S ~/.ssh/ssh_auth_sock ]; then
eval `ssh-agent`
ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock
fi
export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock
ssh-add -l | grep "The agent has no identities" && ssh-add
@maateen
maateen / servers.py
Last active December 20, 2016 22:16
Hello Sysadmin, make life easier on Terminal. :)
"""
Documentation
1. At first, save the entire script as servers.py in /home/your-username/ directory.
Also you can simply use the below command:
curl "https://gist.githubusercontent.com/maateen/1582a28d62437caaf5cf9098303bab79/raw/e216b3b1ff8f1323fb79de4ae5a4c5b24a8b2c4d/servers.py" > ~/servers.py
2. Change info in servers = {} portion according to your need.
Always use Server Identity at the left side of : sign and SSH Login Command at the right side.
@maateen
maateen / multiple-modals-semantic.html
Created January 12, 2017 13:53 — forked from marcosfreitas/multiple-modals-semantic.html
Creating Multiple Modals in Semantic UI :)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Multiple Modals With Semantic UI</title>
<link rel="stylesheet" href="path_to_semantic/dist/semantic.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="path_to_semantic/dist/semantic.js"></script>
</head>
<body>
@maateen
maateen / ReactApp.jsx
Created January 12, 2017 13:54 — forked from jeanlescure/ReactApp.jsx
Using Semantic UI Modal in a React.js App
var HelloModal = React.createClass({
getInitialState: function() {
return {
visible: false
};
},
componentDidMount: function() {
var self = this;
$(window).on('modal.visible', function(ev){
self.setState({visible: true});
@maateen
maateen / iterm2-solarized.md
Created November 15, 2017 04:31 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@maateen
maateen / docker-cleanup-resources.md
Created January 24, 2018 04:54 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@maateen
maateen / git-lg.sh
Created March 28, 2018 04:47 — forked from angstwad/git-lg.sh
Better Git Log (git lg)
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"