Skip to content

Instantly share code, notes, and snippets.

View icarrr's full-sized avatar
🚴
Cycling anywhere and Work from everywhere

Faizar Septiawan icarrr

🚴
Cycling anywhere and Work from everywhere
View GitHub Profile
##########################################
# To run:
# curl -sSL https://gist.githubusercontent.com/andrewelkins/1adc587feb610f586f8f40b50b7efc3a/install-docker-on-linux-mint-18.sh | bash -x
##########################################
# Kernel version http://stackoverflow.com/a/4024263
versionlte() {
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]
}
versionlt() {
jq '. + { "registry": "https://registry.bower.io" }' .bowerrc > out && mv out .bowerrc
@icarrr
icarrr / mailers.json
Created October 9, 2019 12:52
Phabricator mail config
[
{
"key": "stmp-mailer",
"type": "smtp",
"options": {
"host": "smtp.sendgrid.net",
"port": 587,
"user": "apikey",
"password": "Your_API_Key",
"protocol": "tls"
@icarrr
icarrr / phabricator.conf
Created October 10, 2019 10:26
phabricator conf on apache2
<VirtualHost *:port>
DocumentRoot /var/www/html/repository/phabricator/webroot
RewriteEngine on
RewriteRule ^/rsrc/(.*) - [L,QSA]
RewriteRule ^/favicon.ico - [L,QSA]
RewriteRule ^(.*)$ /index.php?__path__=$1 [B,L,QSA]
ErrorLog ${APACHE_LOG_DIR}/phabricator-error.log
CustomLog ${APACHE_LOG_DIR}/phabricator-access.log combined
@icarrr
icarrr / docker-ce.sh
Created October 17, 2019 07:00
Install Docker CE and Docker Compose on CentOS 7 or RHEL 7
sudo yum install -y epel-release
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install -y docker-ce
sudo usermod -aG docker $(whoami)
sudo systemctl enable docker.service
sudo systemctl start docker.service
sudo docker version
@icarrr
icarrr / linux.sh
Last active November 12, 2019 08:31
Get Time by Head Google
date '+%Y%m%d_%H%M%S' -d "$(curl -s --head http://google.com | grep ^Date: | sed 's/Date: //g')"
@icarrr
icarrr / FaM.md
Created October 25, 2019 15:13
Find and Move
$ find /home -iname '*.zip' -exec mv '{}' /backup/ \;
@icarrr
icarrr / rewrite.md
Created October 31, 2019 04:46
Configuration redirect root site using nginx

Redirect root site to other site

location = / {
    return 301 http://www.example.com/wiki/Main_Page;
}

Redirect root site to subdirectory in nginx

location = / {
@icarrr
icarrr / bamboo.service
Created November 1, 2019 04:26
Bamboo service as systemd
[Unit]
Description=Atlassian Bamboo
After=syslog.target network.target
[Service]
Type=forking
User=bamboo
ExecStart=/usr/local/bamboo/atlassian-bamboo/bin/start-bamboo.sh
ExecStop=/usr/local/bamboo/atlassian-bamboo/bin/stop-bamboo.sh
SuccessExitStatus=143
@icarrr
icarrr / bamboo.conf
Created November 1, 2019 04:33
Bamboo nginx reverse proxy
server {
server_name domain.id;
# NGINX usually only allows 1M per request. Increase this to JIRA's maximum attachment size (10M by default)
client_max_body_size 10M;
access_log /var/log/nginx/bamboo_access.log;
error_log /var/log/nginx/bamboo_error.log warn;
location / {