Skip to content

Instantly share code, notes, and snippets.

View Johnz86's full-sized avatar

Jan Jakubcik Johnz86

  • Slovakia
View GitHub Profile
@Johnz86
Johnz86 / get_packages_folders.sh
Last active August 29, 2015 14:08
Get list of python folders inside site-packages excluding eggs, setuptools and pip.
ls /opt/xenadm/venv/lib/python2.7/site-packages/ | grep -E -v "egg-info|pyc|py|setuptools|pip"
@Johnz86
Johnz86 / link_libs_to_packages.sh
Created November 7, 2014 10:02
Symlink all folders from virtualenv shared libs to site-packages.
package web.acceptance.utility;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.interactions.Actions;
public class FirefoxResponsiveMode {
public static void pressShortcut(WebDriver driver) {
#!/bin/sh
function vowel() {
vowels=aeiouy
p=$(( $RANDOM % ${#vowels}))
echo -n ${vowels:$p:1}
}
function consonant(){
consonants=bcdfghjklmnpqrstvwxz
randomNumber=$(( $RANDOM % ${#consonants}))
@Johnz86
Johnz86 / jersey-quickstart-webapp
Last active March 29, 2016 19:35
jersey-quickstart-webapp oneliners
mvn dependency:get -DrepoUrl=http://repo1.maven.org/maven2/ -Dartifact=org.glassfish.jersey.archetypes:jersey-example-java8-webapp:2.22.2
mvn archetype:generate -DarchetypeArtifactId=jersey-quickstart-grizzly2 -DarchetypeGroupId=org.glassfish.jersey.archetypes -DinteractiveMode=false -DgroupId=com.webus -DartifactId=simple-service -Dpackage=com.webus -DarchetypeVersion=2.22.2
mvn archetype:generate -DarchetypeArtifactId=jersey-quickstart-webapp -DarchetypeGroupId=org.glassfish.jersey.archetypes -DinteractiveMode=false -DgroupId=com.webus -DartifactId=simple-service-webapp -Dpackage=com.webus -DarchetypeVersion=2.22.2
mvn install:install-file -Dfile=serenity-cucumber-archetype-1.0.7.jar -DgroupId=net.serenity-bdd -DartifactId=serenity-cucumber-archetype -Dversion=1.0.7 -Dpackaging=jar -DgeneratePom=true
mvn archetype:generate -DarchetypeGroupId=net.serenity-bdd -DarchetypeArtifactId=serenity-cucumber-archetype -DarchetypeVersion=1.0.7 -DgroupId=sk.webus -DartifactId=featureapp -Dversion=1.0.0
@Johnz86
Johnz86 / jaas_tomcat_encrypt.bat
Created August 17, 2016 11:34
Command for hashing the realm passwords in tomcat
java -cp bin\tomcat-juli.jar;lib\* org.apache.catalina.realm.RealmBase -a SHA this_is_the_hashed_password
@Johnz86
Johnz86 / settings.json
Created November 30, 2016 14:28
.vscode settings file for running git bash as terminal, custom typescript lib and unix line endings.
// Place your settings in this file to overwrite default and user settings.
{
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
"typescript.tsdk": "./node_modules/typescript/lib",
"workbench.editor.enablePreview": false,
"workbench.editor.enablePreviewFromQuickOpen": false,
"files.eol": "\n",
"editor.formatOnSave": true
}
@Johnz86
Johnz86 / deploy-image-to-aws.sh
Created November 30, 2016 14:31
Deploy image to aws and restart the task and service to redeploy new container.
#!/bin/bash
awsRegion=eu-west-1
containerName=imagepool_web
containerRepository=126375660691.dkr.ecr.eu-west-1.amazonaws.com/image-pool
version=0.1
increment_version (){
declare -a part=( ${1//\./ } )
declare new
@Johnz86
Johnz86 / docker-setting.sh
Created November 30, 2016 14:32
Load docker environment in git bash on windows and start custom shell script
#!/bin/bash
#usage: source ./tasks/docker-setting.sh
echo "# Set environment variables in bash for default docker machine #"
echo -en "\n"
echo $(docker-machine env default --shell sh/bash)
eval $(docker-machine env default --shell sh/bash)