Skip to content

Instantly share code, notes, and snippets.

View irusri's full-sized avatar
🌱

Chanaka Mannapperuma irusri

🌱
View GitHub Profile
@irusri
irusri / qnorm.js
Created April 15, 2020 04:35 — forked from dtuite/qnorm.js
qnorm.js
// Originally found at: http://rangevoting.org/Qnorm.html
/** * @(#)qnorm.js * * Copyright (c) 2000 by Sundar Dorai-Raj
* * @author Sundar Dorai-Raj
* * Email: sdoraira@vt.edu
* * This program is free software; you can redistribute it and/or
* * modify it under the terms of the GNU General Public License
* * as published by the Free Software Foundation; either version 2
* * of the License, or (at your option) any later version,
* * provided that any use properly credits the author.
@irusri
irusri / mysql_debian_user.md
Created February 10, 2020 23:39 — forked from jaircuevajunior/mysql_debian_user.md
Fix logrotate error regarding mysql on Ubuntu

Fix logrotate error regarding mysql on Ubuntu

Sometimes if you are mailed of cronjobs, will may got an error like this:

/etc/cron.daily/logrotate:
error: error running shared postrotate script for '/var/log/mysql.log /var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log /var/log/mysql/error.log '
run-parts: /etc/cron.daily/logrotate exited with return code 1

Well, don't panic! Also don't ignore it! :)

@irusri
irusri / gist:79881590133487d3441e3042259bb90f
Created November 28, 2018 10:03 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@irusri
irusri / awk-oneliner.sh
Created November 12, 2017 20:10 — forked from himalay/awk-oneliner.sh
Useful One-Line Scripts for awk command.
#HANDY ONE-LINE SCRIPTS FOR AWK 30 April 2008
#Compiled by Eric Pement - eric [at] pement.org version 0.27
#Latest version of this file (in English) is usually at:
# http://www.pement.org/awk/awk1line.txt
#This file will also be available in other languages:
# Chinese - http://ximix.org/translation/awk1line_zh-CN.txt
#USAGE:
@irusri
irusri / mysql.sh
Created March 21, 2016 21:48 — forked from valerio-bozzolan/mysql.sh
Debian GNU/Linux MySQL-MariaDB autologin
#!/bin/bash
########################################
# MySQL | MariaDB autologin
# License: GNU GPL v3+
# Author: Valerio Bozzolan
########################################
file=/etc/mysql/debian.cnf
while [ -z "$user" ] && read ln; do