Skip to content

Instantly share code, notes, and snippets.

View muhfaris's full-sized avatar
:octocat:
Focusing

Muhammad Faris 'Afif muhfaris

:octocat:
Focusing
View GitHub Profile
@muhfaris
muhfaris / scrap.py
Created December 9, 2016 01:48
scrape debugger facebook, open url link
import subprocess
import webbrowser
import sys
from socket import error as SocketError
import urllib
import errno
import time
with open('/mnt/Data/temp/test_manual/temp_links_2.txt','r') as infile:
data = infile.read()
listme = data.splitlines()
@muhfaris
muhfaris / domain.conf
Created December 31, 2016 09:07
konfigurasi virtual host (subdomain) cdn
server {
listen 80;
server_name www.media.domain.com media.domain.com;
return 301 https://media.domain.com$request_uri;
location ~* .(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|htm|html|js|css|mp3|swf|ico|flv)$ {
expires max;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://domain.com;
proxy_ignore_headers X-Accel-Expires Expires Cache-Control;
@muhfaris
muhfaris / fail2ban.conf
Last active January 17, 2017 19:54
Melindungi wp-login dari scriptkiddies menggunakan fail2ban
# rules wp-auth.conf
[Definition]
failregex = [[]client <HOST>[]] WP login failed.*
ignoreregex =
# konfig jail.local
[wordpress]
enabled = true
filter = wp-auth
@muhfaris
muhfaris / backup.txt
Created January 19, 2017 07:56
backup in bash shell
#!/bin/bash
NOW=$(date +"%Y-%m-%d")
mysqldump -uroot --all-databases > ~/Dropbox/Backup/Database/db_all_$NOW.sql
tar cfz ~/Dropbox/Backup/devwp_$NOW.tar.gz /var/www/devwp.com
tar cfz ~/Dropbox/Backup/devw3_$NOW.tar.gz /var/www/devw3.com
gzip -9 -q -f ~/Dropbox/Backup/Database/db_all_$NOW.sql
#referensi
#https://www.dropbox.com/install-linux
@muhfaris
muhfaris / Source_py.txt
Created January 28, 2017 04:31
Learn More
Learninng Python
1. Python For Beginners | https://staging.python.org/about/gettingstarted/
2. IDOL -Python - Most Recent Stories | http://codeidol.com/community/python/
3. The Definitive Guide to Pylons - James Gardner | http://pylonsbook.com/en/1.0/
4. The Tutorial Python 3 | https://docs.python.org/3/tutorial/index.html
5. Stagging Python | https://staging.python.org/
6. Scraping Python | http://stackoverflow.com/questions/22676/how-do-i-download-a-file-over-http-using-python
Other
@muhfaris
muhfaris / domain.conf
Created February 17, 2017 21:16
CORS - Enable Nginx, pengaturan untuk font, ttf, woff, woff2 dll. dan tidak bisa membuat location root karena sudah ada
server {
listen 80;
server_name www.media.domain.com media.domain.com;
location ~* .(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|htm|html|js|css|mp3|swf|ico|flv|woff|woff2|ttf)$ {
expires max;
.................
.................
other configuration
.................
@muhfaris
muhfaris / nginx.conf
Created February 24, 2017 09:45
Konfigurasi Nginx nginx version: nginx/1.10.3 dan PHP 7.1.2
server {
....
....
location ~ .php$ {
root /usr/share/nginx/html;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name;
@muhfaris
muhfaris / sftp-ubuntu.md
Created February 27, 2017 03:10 — forked from joshellington/sftp-ubuntu.md
Basic tutorial for creating a SFTP-only user on Ubuntu 9.04 and greater

Adding SFTP-only user to Ubuntu Server

To add a SFTP-only user, you'll need to make sure your SSH config settings are correct, add a new user/group and set permissions for your new user. For step-by-step directions, see below. Omit sudo if you're logged in as root.

Directions

  1. Edit /etc/ssh/sshd_config and make sure to add the following at the end of the file:

     Match group filetransfer
    

ChrootDirectory %h

@muhfaris
muhfaris / wp-login.md
Created March 7, 2017 12:49
wp-login
  1. Buka wp-login.php, cari dan rubah 'wp-login.php' dengan alamat baru.php.
  2. Buka /wp-includes/general-template.php, cari script dibawah in dan ganti wp-login.php dengan alamat baru.php :
$logout_url = add_query_arg($args, site_url(‘wp-login.php‘, ‘login’));
@muhfaris
muhfaris / dasar_html5.html
Created March 16, 2017 03:20
Pola desain HTML5
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title> ... </title>
</head>
<body>
<header role="banner">