Instantly share code, notes, and snippets.

View splunk
SPL = Splunk Processing Language
host="<host>"
source="<source>"
sourcetype="<sourcetype>"
* can be used as a wildcard
| used to chain filtering / commands / searches
Full Search Reference: http://docs.splunk.com/Documentation/Splunk/7.0.1/SearchReference/WhatsInThisManual
View locations
OSX (Sierra)
=====
/usr/libexec/java_home - Reports on current JAVA_HOME (or at least what it should be)
/usr/local/apache-tomcat-8.5.23 - Tomcat installation
Linux
=====
Bash Profiles
~/.bashrc
~/.bash_profile
View android
IDE
======
Recommended -> Android Studio
Common (Legacy) -> Eclipse with Android Development Tools (ADT)
Requires Android SDK + Java JDK
Applications are ran in an emulator -> Android Virtual Device (AVD) by the AVD Manager
Allows multiple configurations to be created
Different API versions and screen sizes
Detailed configuration, such as memory size and GPS emulation, available
Android applications can be developed on almost any platform
View Swift
General
======
- Strongly typed, object oriented
- Semi-colons are optional to end statements
- // or /* */ for comments
- Used across Apple platforms
- Execution starts in main.swift
- Libraries imported using import statements
- Can use any unicode character in names
- Short circuits evaluations of conditional statements
View docker
Install: https://docs.docker.com/engine/installation/mac/#/docker-for-mac
Docker Hub (for images): https://hub.docker.com/
GENERAL
Images have many different names on docker hub, also able to select release candidate etc
Try and use less steps and remove unwanted files in each step of a docker image build
Each step of a build is a read-only layer onto of the last
tty may keep container alive when using docker-compose
RUN / EXEC
View vagrant
Settings contained in VagrantFile
vagrant up
- Pull dependencies and start VM (run from project root)
vagrant destroy -f
- Force destroy VMs
vagrant ssh <box>
- SSH onto a running VM
View URLCharacterEncodings
Character From Windows-1252 From UTF-8
space %20 %20
! %21 %21
" %22 %22
# %23 %23
$ %24 %24
% %25 %25
& %26 %26
' %27 %27
( %28 %28
View mantras
Don't Repeat Yourself - DRY
- Don't repeat code
- Use reusability
Keep It Simple Stupid - KISS
- Don't overcomplicate for it's own sake
Don't make me think
Program to an interface
Composisition over inher
View jboss
sudo jboss_user
jbmgr status
jbmgr mdb <item> stop
- Stop mdb related to service
jbmgr restart <list>
- Restart list of services
View exit
1 Catchall for general errors let "var1 = 1/0" Miscellaneous errors, such as "divide by zero" and other impermissible operations
2 Misuse of shell builtins (according to Bash documentation) empty_function() {} Missing keyword or command, or permission problem (and diff return code on a failed binary file comparison).
126 Command invoked cannot execute /dev/null Permission problem or command is not an executable
127 "command not found" illegal_command Possible problem with $PATH or a typo
128 Invalid argument to exit exit 3.14159 exit takes only integer args in the range 0 - 255 (see first footnote)
128+n Fatal error signal "n" kill -9 $PPID of script $? returns 137 (128 + 9)
130 Script terminated by Control-C Ctl-C Control-C is fatal error signal 2, (130 = 128 + 2, see above)
255* Exit status out of range exit -1 exit takes only integer args in the range 0 - 255