I've been trying to understand how to setup systems from
the ground up on Ubuntu. I just installed redis
onto
the box and here's how I did it and some things to look
out for.
To install:
# ======================================== | |
# Testing n-gram analysis in ElasticSearch | |
# ======================================== | |
curl -X DELETE localhost:9200/ngram_test | |
curl -X PUT localhost:9200/ngram_test -d ' | |
{ | |
"settings" : { | |
"index" : { | |
"analysis" : { |
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
# Install Bash 4 using homebrew | |
brew install bash | |
# Or build it from source... | |
curl -O http://ftp.gnu.org/gnu/bash/bash-4.2.tar.gz | |
tar xzf bash-4.2.tar.gz | |
cd bash-4.2 | |
./configure --prefix=/usr/local/bin && make && sudo make install | |
# Add the new shell to the list of legit shells |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
In August 2007 a hacker found a way to expose the PHP source code on facebook.com. He retrieved two files and then emailed them to me, and I wrote about the issue:
http://techcrunch.com/2007/08/11/facebook-source-code-leaked/
It became a big deal:
http://www.techmeme.com/070812/p1#a070812p1
The two files are index.php (the homepage) and search.php (the search page)
import java.io.*; | |
import java.nio.file.*; | |
import java.security.*; | |
import java.security.cert.*; | |
import javax.net.ssl.*; | |
import org.bouncycastle.jce.provider.*; | |
import org.bouncycastle.openssl.*; | |
public class SslUtil |