-
export SECRET_KEY_BASE
export SECRET_KEY_BASE=`rake secret`
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
# Use only one line eithor in bash script file or command line to display a digital clock. | |
# This line also shows in bash script | |
# - A example of endless loop | |
# - Assigning output of command to a variable | |
# - "-n" "-e" of echo command | |
# - "\r" is used to reset the current line output | |
while sleep 1; do o=$(date); echo -n -e "\r$o"; done |
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
wg https://nodejs.org/dist/v6.10.2/node-v6.10.2-linux-x64.tar.xz | |
unxz node-v6.10.2-linux-x64.tar.xz | |
tar -xf node-v6.10.2-linux-x64.tar | |
mkdir /usr/node | |
mv node-v6.10.2-linux-x64 /usr/node | |
ln -s /usr/node/node-v6.10.2-linux-x64 /usr/node/default | |
vi ~/.bash_profile | |
------------------------------------ |
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
svn update | |
=> | |
git stash && git pull && git stash pop --index |
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
## Configure eth0 | |
# | |
# vi /etc/sysconfig/network-scripts/ifcfg-eth0 | |
DEVICE="eth0" | |
NM_CONTROLLED="yes" | |
ONBOOT=yes | |
HWADDR=A4:BA:DB:37:F1:04 | |
TYPE=Ethernet | |
BOOTPROTO=static |
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
http://php.net/manual/en/security.hiding.php | |
So far I haven't seen a working rewriter of /foo/bar into /foo/bar.php, so I created my own. It does work in top-level directory AND subdirectories and it doesn't need hardcoding the RewriteBase. | |
.htaccess | |
RewriteEngine on | |
# Rewrite /foo/bar to /foo/bar.php | |
RewriteRule ^([^.?]+)$ %{REQUEST_URI}.php [L] |
https://code.google.com/archive/p/json-simple/wikis/EncodingExamples.wiki
// import org.json.simple.JSONObject;
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
{"lastUpload":"2020-03-13T02:12:56.522Z","extensionVersion":"v3.4.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
package main | |
import ( | |
"bytes" | |
"encoding/csv" | |
"fmt" | |
) | |
func main() { | |
array := []string{"a s,dA", "Bdaf"} |
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
require 'openssl' | |
require 'base64' | |
def aes_128_ecbe key, data | |
cipher = OpenSSL::Cipher.new('AES-128-ECB') | |
cipher.encrypt # this needs to be called first to make encryption work for AES-128-ECB | |
cipher.key = key | |
cipher.padding = 1 |