Skip to content

Instantly share code, notes, and snippets.

@aimtiaz11
aimtiaz11 / rotatelog.sh
Last active June 23, 2017 04:55
UNIX - A simple script to rotate log files
## The following is a simple script to rotate log files. Schedule it using crontab to regularly
## rotate log files.
## The script works by backing up the target log file (using cp) and then emptying it out.
## Usage:
## ./rotatelog.sh <<file name>>
## License MIT
DATESTAMP=`date +'%Y%m%d-%H%M'`
BACKUP_LOG_FILE=backup.$DATESTAMP.log
@aimtiaz11
aimtiaz11 / README.md
Last active October 7, 2016 11:59
How to Install TigerVNC

Installing TigerVNC

The following steps show how to install VNC in RHEL/OEL Linux distros.

Setup VNC Server:

yum install tigervnc-server

Edit the vncservers config file:

@aimtiaz11
aimtiaz11 / useful.js
Created July 31, 2015 23:47
Collection of some useful (random) functions in Javascript
/**
* Generates random integer between 2 interval.
* Used for
* @param min
* @param max
* @returns {*}
*/
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
@psayre23
psayre23 / gist:c30a821239f4818b0709
Last active February 8, 2025 08:49
Runtime Complexity of Java Collections
Below are the Big O performance of common functions of different Java Collections.
List | Add | Remove | Get | Contains | Next | Data Structure
---------------------|------|--------|------|----------|------|---------------
ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array
LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List
CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | Array
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"