Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View iqbwl's full-sized avatar
💭
I may be slow to respond.

iqbwl iqbwl

💭
I may be slow to respond.
View GitHub Profile
@iqbwl
iqbwl / ssh-telegram.sh
Created January 7, 2022 04:27 — forked from matriphe/ssh-telegram.sh
Bash Script to notify via Telegram Bot API when user log in SSH
# save it as /etc/profile.d/ssh-telegram.sh
# use jq to parse JSON from ipinfo.io
# get jq from here http://stedolan.github.io/jq/
USERID="<target_user_id>"
KEY="<bot_private_key>"
TIMEOUT="10"
URL="https://api.telegram.org/bot$KEY/sendMessage"
DATE_EXEC="$(date "+%d %b %Y %H:%M")"
TMPFILE='/tmp/ipinfo-$DATE_EXEC.txt'
if [ -n "$SSH_CLIENT" ]; then
map $http_user_agent $is_desktop {
default 0;
~*linux.*android|windows\s+(?:ce|phone) 0; # exceptions to the rule
~*spider|crawl|slurp|bot 1; # bots
~*windows|linux|os\s+x\s*[\d\._]+|solaris|bsd 1; # OSes
}
server {
listen 80;
@iqbwl
iqbwl / galxe
Created September 13, 2022 19:16
Verify Github on Galxe. gid:A7FwJcceQQv43SQRf2LKA
@iqbwl
iqbwl / nextcloud.conf
Created September 22, 2022 17:41
NextCloud Nginx
upstream php-handler {
server 127.0.0.1:9000;
#server unix:/var/run/php/php7.4-fpm.sock;
}
# Set the `immutable` cache control options only for assets with a cache busting `v` argument
map $arg_v $asset_immutable {
"" "";
default "immutable";
}