Skip to content

Instantly share code, notes, and snippets.

View akhiljalagam's full-sized avatar
🎯
Focusing

Akhil Jalagam akhiljalagam

🎯
Focusing
View GitHub Profile
# Centos 7.1
yum -y install wget
wget http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
rpm -ivh nux-dextop-release-0-5.el7.nux.noarch.rpm
yum -y install deluge-web
systemctl start deluge-web
systemctl stop firewalld
@akhiljalagam
akhiljalagam / synapse.service
Created June 14, 2019 13:00
systemd service unit for matrix synapse server 1.0.0 stable release. Tweak with your own config.
[Unit]
Description=Synapse Matrix homeserver
After=postgresql-9.6.service
[Service]
Type=simple
WorkingDirectory=/root/synapse/env
ExecStart=/root/synapse/env/bin/python -m synapse.app.homeserver --config-path=/root/synapse/env/bin/homeserver.yaml
ExecStop=/root/synapse/env/bin/synctl stop /root/synapse/env/bin/homeserver.yaml
@akhiljalagam
akhiljalagam / tracefile
Last active June 21, 2019 05:53
tracefile: Output from cmd on stdout can mess up output from strace.
#!/usr/bin/perl
=head1 NAME
tracefile - list files being accessed
=head1 SYNOPSIS
B<tracefile> [-adeflnruw] I<command>
@akhiljalagam
akhiljalagam / git-auto-sign-commits.sh
Created September 18, 2019 09:07 — forked from mort3za/git-auto-sign-commits.sh
Auto sign your git commits
# Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands)
gpg --gen-key
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null`
# check current keys:
gpg --list-secret-keys --keyid-format LONG
# See your gpg public key:
gpg --armor --export YOUR_KEY_ID
# YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333)
@akhiljalagam
akhiljalagam / pre-commit.sh
Created September 18, 2019 11:00 — forked from milancermak/pre-commit.sh
Python pre-commit hook
#!/bin/sh
# make sure requirements.txt is up to date with every commit
# by comparing the output of pip freeze
pip freeze | diff requirements.txt - > /dev/null
if [ $? != 0 ]
then
echo "Missing python module dependencies in requirements.txt. Run 'pip freeze > requirements.txt' to update."
exit 1
fi
@akhiljalagam
akhiljalagam / apps-bin-path.sh
Created September 19, 2019 09:52 — forked from luispabon/apps-bin-path.sh
Snap app support in shell
# shellcheck shell=sh
# Expand $PATH to include the directory where snappy applications go.
snap_bin_path="/snap/bin"
if [ -n "${PATH##*${snap_bin_path}}" -a -n "${PATH##*${snap_bin_path}:*}" ]; then
export PATH=$PATH:${snap_bin_path}
fi
# Ensure base distro defaults xdg path are set if nothing filed up some
# defaults yet.
@akhiljalagam
akhiljalagam / dmenu_path
Created October 24, 2019 11:33 — forked from webstrand/dmenu_path
dmenu_path supporting bash aliases
#!/bin/bash
cachedir=${XDG_CACHE_HOME:-"$HOME/.cache"}
if [ -d "$cachedir" ]; then
cache=$cachedir/dmenu_run
else
cache=$HOME/.dmenu_cache # if no xdg dir, fall back to dotfile in ~
fi
IFS=:
if stest -dqr -n "$cache" $PATH; then
compgen -ac | sort -u | tee "$cache"
@akhiljalagam
akhiljalagam / NC-MySQLDUMP.sh
Last active October 31, 2019 10:39 — forked from vanjos/NC-MySQLDUMP.sh
Easy way to do a mysqldump and restore using netcat... with and without encryption
#!/bin/bash
#####
# You'll be needing two machines, the target machine and source one (makes sense, right)?
# without encryption
#####
# On the target machine
nc -l 55555 | gzip -d -c | mysql <database name> -u<user> -p<password> [ | <decrypt> ]
@akhiljalagam
akhiljalagam / nginx.conf
Last active October 31, 2019 10:47
grafana proxying dashboard queries based on user account...
worker_processes 2;
events {
worker_connections 1024;
}
http {
# access_log off;
access_log /var/log/nginx/access.log;
@akhiljalagam
akhiljalagam / net-speed-and-brightness.sh
Created November 26, 2019 08:08
display brightness and net speed on i3 status bar
#!/bin/sh
# Authors:
# - Moritz Warning <moritzwarning@web.de> (2016)
# - Zhong Jianxin <azuwis@gmail.com> (2014)
# - Akhil Jalagam <contact@akhil.io> (2019)
#
# See file LICENSE at the project root directory for license information.
#
# i3status.conf should contain: