Skip to content

Instantly share code, notes, and snippets.

View mkindika's full-sized avatar

Indika Munaweera mkindika

  • netstarter
View GitHub Profile
@mkindika
mkindika / clean.sh
Created February 22, 2020 09:31 — forked from Iman/clean.sh
Free up disk space on Ubuntu - clean log, cache, archive packages/apt archives, orphaned packages, old kernel and remove the trash
#!/bin/sh
#Check the Drive Space Used by Cached Files
du -sh /var/cache/apt/archives
#Clean all the log file
#for logs in `find /var/log -type f`; do > $logs; done
logs=`find /var/log -type f`
for i in $logs
@mkindika
mkindika / nginx.conf
Created March 29, 2019 10:34 — forked from micho/nginx.conf
nginx config for http/https proxy to localhost:3000
First, install nginx for mac with "brew install nginx".
Then follow homebrew's instructions to know where the config file is.
1. To use https you will need a self-signed certificate: https://devcenter.heroku.com/articles/ssl-certificate-self
2. Copy it somewhere (use full path in the example below for server.* files)
3. sudo nginx -s reload
4. Access https://localhost/
Edit /usr/local/etc/nginx/nginx.conf:
@mkindika
mkindika / .gitignore
Created November 23, 2018 06:22 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@mkindika
mkindika / ResultList.java
Last active October 9, 2017 12:00
indika.me
query.setMaxResults(1);
List<T> list = query.getResultList();
if (!list.isEmpty()) {
return list.get(0);
}