This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2016 Google Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
asciinema rec -c "tmux attach -t 3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
#Ask some info | |
echo -n "Enter ELK Server IP or FQDN: " | |
read eip | |
echo -n "Enter Admin Web Password: " | |
read adpwd | |
#Update System | |
sudo apt-get update | |
sudo apt-get upgrade -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# code is from http://helw.net/2015/07/19/migrating-to-hugo-from-hexo/ | |
# Ran fine on Windows 10 with MSysGit installed | |
# cd to directory with all the md files from Hexo | |
# bash hexo2hugo.sh | |
--- | |
# ensure dates don't start with single quotes | |
for file in *; do awk '{ | |
if ($1 == "date:") { | |
gsub("\047", "", $0); print; | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt install ruby ruby-dev | |
sudo gem install travis | |
# install path: /var/lib/gems/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import ply.yacc as yacc | |
import ply.lex as lex | |
tokens = ( | |
'INCREMENT', | |
'DECREMENT', | |
'SHIFT_LEFT', | |
'SHIFT_RIGHT', | |
'OUTPUT', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
class NonCapturing { | |
public static void main(String... args) { | |
run(new Runnable() { | |
@Override public void run() { | |
System.out.println("Hey!"); | |
} | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Iterator; | |
import java.util.NoSuchElementException; | |
// Introduction: | |
// | |
// This is an example class meant to illustrate several differen concepts: | |
// * The use of type parameters (i.e. Java generics) | |
// * Implementing an iterator over some collection, in this case an array | |
// * Implementing the Iterable interface, which enables your collection | |
// to work with the Java simple for loops, i.e. (for String s : list) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Reference: | |
https://www.cloudgear.net/blog/2015/5-minutes-kubernetes-setup/ | |
# install homebrew and cask | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# install virtualbox | |
brew cask install virtualbox | |
# install dockertoolbox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |