Skip to content

Instantly share code, notes, and snippets.

git filter-branch --force --env-filter '
NAME="anonymous"
EMAIL="anonymous@anonymous.anonymous"
export GIT_COMMITTER_NAME="$NAME"
export GIT_COMMITTER_EMAIL="$EMAIL"
export GIT_AUTHOR_NAME="$NAME"
export GIT_AUTHOR_EMAIL="$EMAIL"
cd $OPENSHIFT_DATA_DIR
#Install java8
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u45-b14/jdk-8u45-linux-x64.tar.gz
tar xvf jdk-8u45-linux-x64.tar.gz
export PATH=$OPENSHIFT_DATA_DIR/jdk1.8.0_45/bin:$PATH
export JAVA_HOME="$OPENSHIFT_DATA_DIR/jdk1.8.0_45"
#Install nodejs and npm:
wget https://nodejs.org/dist/v0.12.5/node-v0.12.5-linux-x86.tar.gz
@dimhold
dimhold / JKSBuilder.java
Last active March 5, 2021 09:48
Convert der to jks
import java.io.ByteArrayInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.KeyFactory;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
@dimhold
dimhold / create-admin.sql
Last active August 29, 2015 14:21
Create admin for wordpress
INSERT INTO `obi`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('4', 'admin', MD5('admin'), 'admin', 'admin@admin.com', 'http://www.test.com/', '2011-06-07 00:00:00', '', '0', 'admin');
INSERT INTO `obi`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '4', 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');
INSERT INTO `obi`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '4', 'wp_user_level', '10');
@dimhold
dimhold / github-network.user.js
Last active November 26, 2015 11:11
Add network menu item to the main page of repository
// ==UserScript==
// @name github-network.user.js
// @namespace https://github.com/
// @description Add network menu item to the main page of repository
// @include https://github.com/*
// @version 2.0.1
// @grant none
// ==/UserScript==
var repo = window.location.pathname;
if (repo) {
@dimhold
dimhold / 40_custom
Created September 11, 2014 07:44
Grub windows menu
#/etc/grub.d/40_custom
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry "Windows 7" {
insmod part_msdos
insmod ntfs
@dimhold
dimhold / .gitconfig
Created September 10, 2014 19:54
Git config example
[user]
name = user
email = user@gmail.com
[alias]
co = checkout
s = status
b = branch
c = commit -a -m
l = log --stat
g = log --graph
@dimhold
dimhold / xorg.conf
Created September 9, 2014 19:45
Xorg config section for use capslock button to change keyboard layouts.
#/etc/X11/xorg.conf.d/xorg.conf
#Use capslock button to change keyboard layouts.
Section "InputClass"
Identifier "keyboard-all"
Driver "evdev"
Option "XkbLayout" "us,ru"
Option "XkbOptions" "grp:caps_toggle,grp_led:scroll"
MatchIsKeyboard "on"
EndSection
@dimhold
dimhold / youtube-subscriptions-refresh.user.js
Last active August 29, 2015 14:05
Make My Subscriptions tab clickable for refresh
// ==UserScript==
// @name youtube-subscriptions-refresh.user.js
// @namespace https://www.youtube.com/feed/subscriptions
// @description Make My Subscriptions tab clickable for refresh
// @include https://www.youtube.com/feed/subscriptions
// @version 1.0.0
// @grant none
// ==/UserScript==
var tab = document.getElementsByClassName("epic-nav-item-heading")[0];
tab.addEventListener("click", function () {
@dimhold
dimhold / github-stars-link.user.js
Last active August 29, 2015 14:05
Add stars link to github head (UserScript)