Skip to content

Instantly share code, notes, and snippets.

@junaidk
junaidk / ReadMe
Last active August 29, 2015 14:07
Maven Scala pom + Eclipse
In eclipse create configuration for project. With Main class name.
@junaidk
junaidk / idea.md
Last active August 29, 2015 14:10
Intelli j idea shortcuts

These are some of my most used keyboard short cuts

  • Syntax aware selection in the editor selects a word at the caret and then selects expanding areas of the source code. For example, it may select a method name, then the expression that calls this method, then the whole statement, then the containing block, etc.: Ctrl+W

  • Basic Code Completion, to complete methods, keywords etc.: Ctrl+Space

  • Go to Declaration. Use this to navigate to the declaration of a class, method or variable used somewhere in the code: Ctrl+B

  • Introduce Variable Refactoring, to create a variable from an expression. This expression may even be incomplete or contain errors. Since version 8, IDEA intelligently selects a likely expression when no text is selected: Ctrl+Alt+V

@junaidk
junaidk / signAndAlign.py
Created December 26, 2014 14:12
Sign and align multiple unaligned apks
# java and sdk tools should be on system path
# it needs zipalign and jarsigner tools
# http://developer.android.com/tools/publishing/app-signing.html
from subprocess import call
keyPass = ""
storepass = ""
alias = ""
keyStorePath = ""
@junaidk
junaidk / user.md
Last active August 29, 2015 14:12
create user linux

create a new user

create user and add in group
sudo useradd -G 1000 user
make directory for user
mkdir /home/user
@junaidk
junaidk / Unix.sh
Last active October 31, 2015 15:01
count character in each line of a file
# if number of occurrences of " , " is > 5 print the number
tr -d -c ',\n' < Users.csv | awk '{ if ( length >= 5) {print length;} }'
# if number of occurrences of " , " is > 5 print line number
tr -d -c ',\n' < Users.csv | awk '{ if ( length >= 5) {print NR;} }'
# read nth line from file
awk ' NR == 5' Users.csv
TxnID UserID TimeStampe ItemID Quantity UnitPrice
1 4122 17-09-2011 1:25 47 34 52.48
2 273 17-09-2011 1:53 278 24 82.62
3 3305 17-09-2011 1:55 183 50 52.49
4 3561 17-09-2011 9:37 343 46 55.94
5 1477 17-09-2011 10:07 313 44 56.19
6 1850 17-09-2011 11:30 361 22 89.13
7 1532 17-09-2011 11:48 304 22 78.63
8 3055 17-09-2011 15:16 174 41 39.46
9 1176 17-09-2011 17:40 130 32 73.18

Developer Cheat Sheets

This are my cheat sheets that I have compiled over the years. Tired of searching Google for the same things, I started adding the information here. As time went on, this list has grown. I use this almost everyday and this Gist is the first bookmark on my list for quick and easy access.

I recommend that you compile your own list of cheat sheets as typing out the commands has been super helpful in allowing me to retain the information longer.

@junaidk
junaidk / gist:64ee1ef2677102101689
Last active September 9, 2015 13:40
.desktop file
[Desktop Entry]
Type=Application
Terminal=false
Name=Intellij Idea
Icon= path to icon
Exec= path to .sh file
-----------------
@junaidk
junaidk / show_wifi_clients.sh
Created October 28, 2016 09:48
Show Clients connected to Hotspot
#!/bin/bash
# show_wifi_clients.sh
# Shows MAC, IP address and any hostname info for all connected wifi devices
# written for openwrt 12.09 Attitude Adjustment
# modified by [email protected] from http://wiki.openwrt.org/doc/faq/faq.wireless#how.to.get.a.list.of.connected.clients
echo "# All connected wifi devices, with IP address,"
echo "# hostname (if available), and MAC address."
printf "# %-20s %-30s %-20s\n" "IP address" "lease name" "MAC address"

Keybase proof

I hereby claim:

  • I am junaidk on github.
  • I am junaidk (https://keybase.io/junaidk) on keybase.
  • I have a public key whose fingerprint is A8C1 F384 12DE CDE6 A761 F837 279E 502A 669B DD2C

To claim this, I am signing this object: