Skip to content

Instantly share code, notes, and snippets.

View si294r's full-sized avatar

Chairuddinsyah Siregar si294r

View GitHub Profile

1. Import Key, see here

sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
sudo add-apt-repository 'deb [arch=amd64,i386] http://mariadb.biz.net.id/repo/10.1/ubuntu trusty main'

2. Install MariaDB

1. In Mongo Shell, create user with these script

> use admin
switched to db admin
> db.createUser({ user: 'admin', pwd: 'password', roles: [{ role: 'userAdminAnyDatabase', db: 'admin' }] })
Successfully added user: {
        "user" : "admin",
        "roles" : [
                {
                        "role" : "userAdminAnyDatabase",
        <Location /PushAdmin>
                RequestHeader set X-Forwarded-Proto "https"
                ProxyPass http://localhost:8080/PushAdmin
                ProxyPassReverse http://localhost:8080/PushAdmin
        </Location>
openssl pkcs12 -clcerts -nodes -out BillionaireProduction.pem -in BillionaireProduction.p12
<Directory "/var/www/html">
        RewriteEngine On
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^/?([a-zA-Z_]+)/(.*)$ $1/index.php/$2 [L]
</Directory>
  1. Install Squid
apt-update && apt-get install squid
  1. Edit /etc/squid3/squid.conf
acl alegrium src 122.129.112.154/24
http_access allow alegrium
sysctl net.ipv4.ip_forward=1
iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 5439 -j DNAT --to-destination 52.205.20.41:5439
iptables -t nat -A POSTROUTING -j MASQUERADE
iptables -L -t nat --line-numbers

Install cifs-utils

$ sudo apt-get install cifs-utils

Get GUID

$ id
uid=1000(ubuntu) gid=1000(ubuntu) groups=1000(ubuntu),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),110(lpadmin),111(sambashare)

logrotate

logrotate -f /etc/logrotate.d/apache2

copy log files to /root/logs with "scp" or "docker cp"

scp /var/log/apache2/*.log.1 root@localhost:/root/logs/20170206/
rm /var/log/apache2/*.log.1

autoindex is not working when using php-fpm. The solution is to remove 'index.php' from DirectoryIndex.