Skip to content

Instantly share code, notes, and snippets.

View adikari's full-sized avatar
🏠
Working from home

subash adhikari adikari

🏠
Working from home
View GitHub Profile
@adikari
adikari / install_eclimd
Last active February 8, 2018 03:35
install eclim headless
#!/bin/zsh
cd /tmp
wget http://download.springsource.com/release/ECLIPSE/neon/R/eclipse-jee-neon-R-linux-gtk-x86_64.tar.gz
# eclipse EE
# http://download.springsource.com/release/ECLIPSE/neon/3/eclipse-jee-neon-3-linux-gtk-x86_64.tar.gz
tar -zxf eclipse-jee-neon-R-linux-gtk-x86_64.tar.gz -C /opt
@adikari
adikari / jdbcRealmConfig
Last active April 24, 2017 09:18
create jdbc pool and resource using asadmin
asadmin create-jdbc-connection-pool \
--datasourceclassname org.apache.derby.jdbc.ClientDataSource \
--restype javax.sql.DataSource \
--property URL=“jdbc\\:derby\\://localhost\\:1527/sun-appserv-samples”:driverClass=org.apache.derby.jdbc.ClientDriver:Password=APP:portNumber=1527:databaseName=APP:User=APP:serverName=localhost JDBC
asadmin create-jdbc-resource —connectionpoolid JDBC jdbc/APP
asadmin set server-config.security-service.activate-default-principal-to-role-mapping=true
create-auth-realm --classname com.sun.enterprise.security.auth.realm.jdbc.JDBCRealm \
@adikari
adikari / git_log_filter.sh
Last active November 28, 2017 11:26
filter git log by date and author
git log --all --after="2017-04-05 00:00" --before="2017-05-10 23:59" --author="Subash Adhikari"
# set up fstab /etc/fstab
mkdir /mnt/data
/dev/md0 /mnt/data ext4 defaults 0 2
# set up static IP /etc/network/interfaces
iface em0 inet static
address 192.168.1.128
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.0.1
@adikari
adikari / osx-bootstrap
Last active June 4, 2021 05:13
Bootstrap my mac osx
#!/bin/bash
# install homebrew if not already installed
if ! type "brew" > /dev/null 2>&1; then
echo "installing homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
fi
echo "updating brew..."
brew update
@adikari
adikari / reload_bash_shell.sh
Created December 8, 2017 02:06
reload shell from bash and continue
if [ -f /var/run/rebooting-for-updates ]; then
# start from where we left off on reboot
sed -i '/bash/d' ~/.zshrc
sudo rm -f /var/run/rebooting-for-updates
echo "continuing after shell reload.."
else
echo "running script for the first time"
@adikari
adikari / builder.yml
Created December 14, 2017 05:46
tmuxinator builder configuration
name: builder
root: /SRC/builder
startup_window: client
windows:
- logs:
layout: even-horizontal
panes:
-
- eclim:
Unhandled Exception:
System.InvalidOperationException: Sequence contains no elements
at System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0006c] in <63992662b765477a898ef49cdcc99ee2>:0
at Microsoft.Build.Evaluation.ProjectItem.GetMetadataValue (System.String name) [0x0002b] in <aa05165cb68b445c9d53781a1bbe8199>:0
at OmniSharp.Solution.CSharpProject.AddProjectReferences (Microsoft.Build.Evaluation.Project p) [0x00049] in <70d1eaefa89d474dbc31e56e742e1653>:0
at OmniSharp.Solution.CSharpProject..ctor (OmniSharp.Solution.ISolution solution, System.IO.Abstractions.IFileSystem fileSystem, OmniSharp.Logger logger, System.String title, System.String fileName, System.Guid id) [0x00246] in <70d1eaefa89d474dbc31e56e742e1653>:0
at OmniSharp.Solution.CSharpSolution.LoadProject (System.String title, System.String location, System.String id) [0x0003d] in <70d1eaefa89d474dbc31e56e742e1653>:0
at OmniSharp.Solution.CSharpSolution.LoadSolution () [0x00125] in <70d1eaefa89d
@adikari
adikari / config.json
Last active February 1, 2018 04:42
script to book parking
{
"from": "",
"to": "",
"subject" : "parking request for tomorrow"
}
@adikari
adikari / hello.js
Last active February 19, 2018 03:00
function sayHelloFromExternalScript() {
alert('Hello from external script. I am dynamically loaded.');
}