Skip to content

Instantly share code, notes, and snippets.

@hydra1983
hydra1983 / machine.js
Last active November 27, 2021 17:18
Generated by XState Viz: https://xstate.js.org/viz
const editPageMachine = Machine({
id: 'editPage',
initial: 'preparing',
states: {
preparing: {
on: {
CREAT_ENTITY: 'creating',
UPDATE_ENTITY: 'updating'
}
},
@hydra1983
hydra1983 / README.md
Created October 17, 2017 14:15 — forked from lavaxun/README.md
Rancher on docker-for-mac with xhyve

Install Docker for Mac (http://beta.docker.com)

Install docker-machine-driver-xhyve (https://github.com/zchee/docker-machine-driver-xhyve)

brew install docker-machine-driver-xhyve
sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve

Deploy the latest release

@hydra1983
hydra1983 / ssh-reverse-tunnel
Last active September 13, 2017 18:32
script to start a ssh reverse tunnel using autossh on ubuntu
#! /bin/sh
#
# Author: Edison <hydra1983@gmail.com>
#
# This is a modified version for from Andreas Olsson <andreas@arrakis.se>
# For each tunnel; make a uniquely named copy of this template.
## SETTINGS
#
# remote ssh user
@hydra1983
hydra1983 / how-to-fix-jenkins-openldap-login-failure.md
Created September 8, 2017 08:40
How to fix login failure caused by corruption of openldap in jenkins
  1. Update config.xml, change <useSecurity>true</useSecurity> to <useSecurity>false</useSecurity>
  2. Restart jenkins
  3. Re-configure openldap
@hydra1983
hydra1983 / how-to-restore-inactive-jira-accounts-from-openldap.md
Created September 8, 2017 04:57
How to restore inactive jira accounts after openldap data is cleaned
  1. After openldap is connected from jira
  2. Create a demo account in jira, then the demo account should be created in openldap also
  3. Copy the demo account as the the inactive accounts one by one in openldap
  4. Execute UPDATE cwd_user SET active=1 WHERE CREDENTIAL='nopass' AND active=0 in jira database (MySQL)
  5. Restart jira server
  6. Reset inactive accounts password in jira
  7. Now, it should be working.
@hydra1983
hydra1983 / sonar.properties
Created August 9, 2017 06:03
Sonar OpenLDAP Configuration
#--------------------------------------------------------------------------------------------------
# Security
sonar.security.realm=LDAP
#--------------------------------------------------------------------------------------------------
# LDAP
# General Configuration
ldap.url=ldap://myopenldap:389
ldap.bindDn=cn=admin,dc=myopenldap,dc=com
@hydra1983
hydra1983 / docker_images.sh
Last active May 10, 2024 10:58
Save and load docker images in batch
#!/bin/bash
readonly DB_FILE="$(pwd)/images.db"
readonly IMG_DIR="$(pwd)/images"
save-images() {
echo "Create ${DB_FILE}"
echo "$(docker images|grep -v 'IMAGE ID'|awk '{printf("%s %s %s\n", $1, $2, $3)}'|column -t)" > "${DB_FILE}"
echo "Read ${DB_FILE}"
@hydra1983
hydra1983 / gulpfile.js
Last active August 29, 2015 14:07
Gulp + Browserify + Angularjs
var browserify = require('browserify');
var es6ify = require('es6ify');
var gulp = require('gulp');
var source = require('vinyl-source-stream');
gulp.task('build:libs', function(callback) {
return browserify({
entries: [
require('es6ify').runtime,
],
SVN_REPO_PATH=/opt/subversion/data/repositories
SVN_REPO_DESC=Subversion Repositories
SVN_REPO_PATH=/svn
SVN_REPO_INDEXED=true
SVN_DEFAULT_USERNAME=svn
SVN_DEFAULT_PASSWORD=svn

svn_list_parent_path=$( [[ "$SVN_REPO_INDEXED" = "true" ]] && echo on || echo off )
@hydra1983
hydra1983 / git_svn_merge.md
Last active August 29, 2015 14:03
Merge changes from git to svn
# Fetch all commits
git fetch upstream master

# Find the commit id of last merge
git log

# Generate patches per commit
git format-patch -o <patches dir> <last merge commit id>