Skip to content

Instantly share code, notes, and snippets.

@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]"
@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
@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;
@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 / 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
@JohnRoos
JohnRoos / Invoke-RestMethod with cookie and header.ps1
Last active June 19, 2024 18:30
Invoke-RestMethod with cookies and headers
@guycalledseven
guycalledseven / manual-uninstall-paragon-ntfs.sh
Last active February 7, 2025 03:30
Manually remove Paragon NTFS v15 leftovers MacOS
# after appcleaner does his magic, do this
sudo rm -rf "/Library/Application Support/Paragon Software/"
sudo rm /Library/LaunchDaemons/com.paragon-software.installer.plist
sudo rm /Library/LaunchDaemons/com.paragon-software.ntfs.loader.plist
sudo rm /Library/LaunchDaemons/com.paragon-software.ntfsd.plist
sudo rm /Library/LaunchAgents/com.paragon-software.ntfs.notification-agent.plist
sudo rm -rf /Library/Filesystems/ufsd_NTFS.fs/
sudo rm -rf /Library/PrivilegedHelperTools/com.paragon-software.installer
sudo rm -rf /Library/Extensions/ufsd_NTFS.kext/
@aimtiaz11
aimtiaz11 / readme.md
Last active December 11, 2017 18:18
Spring Data and Kendo Grid Datasource Pagination

Spring Data and Kendo Grid Datasource Pagination

How to implement Kendo Grid pagination and sorting with Spring Data.

Angular

Setup Kendo grid options as below in controller or directive

$scope.publishHistoryGridOptions = {
@aimtiaz11
aimtiaz11 / delete-jobs.py
Last active October 1, 2019 18:01
Python script to delete jobs & nested views in Jenkins-CI
'''
Script to delete jobs and nested views in Jenkins CI including the parent view.
This currently works when you have two-level nested views with jobs under the child view.
Parent view
- Child view 1
- Job 1
- Job 2
- Child view 2
- Job 3
@aimtiaz11
aimtiaz11 / readme.md
Last active December 12, 2018 12:33
Jasypt Encryption & Decryption

Jayspt Encryption & Decryption

Add the following functions to your ~/.bash_profile:

Encrypt

encrypt(){
    /Users/ai/jasypt-1.9.2/bin/encrypt.sh \
    input="$1" \
    password="somesupersecretpassword" \
 stringOutputType="hex"