NginX php-fpm upload max file size

$ sudo nano /etc/php5/fpm/php.ini

upload_max_filesize = 300M
post_max_size = 300M
$ sudo nano /etc/nginx/sites-available/default


        server_name 127.0.0.1;

        client_body_in_file_only clean;
        client_body_buffer_size 32K;
        client_max_body_size 300M;
        sendfile on;
        send_timeout 300s;
$ service php7.0-fpm reload
$ service nginx reload

or
$ sudo /etc/init.d/php7.0-fpm restart
$ sudo /etc/init.d/nginx restart

Screenshot at 2017-03-30 12-08-44

Posted in Debian, Linux Mint | Leave a comment

Update GPG key for Nginx on Debian

$ aptitude update

W: GPG error: http://nginx.org jessie InRelease: The following signatures were invalid: KEYEXPIRED 1471427554
$ apt-key list

pub   2048R/7BD9BF62 2011-08-19 [expired: 2016-08-17]
uid                  nginx signing key <signing-key@nginx.com>
$ curl -O https://nginx.org/keys/nginx_signing.key && apt-key add ./nginx_signing.key

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1561  100  1561    0     0    637      0  0:00:02  0:00:02 --:--:--   637
OK
$ apt-key list

pub   2048R/7BD9BF62 2011-08-19 [expires: 2024-06-14]
uid                  nginx signing key <signing-key@nginx.com>

 

 

https://www.nginx.com/blog/updating-gpg-key-nginx-products/

Posted in Debian | Leave a comment

Change NIC Name on Mint

screenshot-at-2017-01-18-19-44-28

$ ifconfig
enp3s0    Link encap:Ethernet  HWaddr e8:11:32:2d:43:f2  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:209 errors:0 dropped:0 overruns:0 frame:0
          TX packets:209 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:17092 (17.0 KB)  TX bytes:17092 (17.0 KB)

wlp2s0b1  Link encap:Ethernet  HWaddr 00:1b:b1:ac:50:4d  
          inet addr:192.168.111.102  Bcast:192.168.111.255  Mask:255.255.255.0
          inet6 addr: fe80::5d55:d09:d091:db05/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2231 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1463 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2710207 (2.7 MB)  TX bytes:139432 (139.4 KB)
$ sudo nano /etc/default/grub

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

to

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
$ sudo grub-mkconfig -o /boot/grub/grub.cfg

Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-4.4.0-59-generic
Found initrd image: /boot/initrd.img-4.4.0-59-generic
Found linux image: /boot/vmlinuz-4.4.0-53-generic
Found initrd image: /boot/initrd.img-4.4.0-53-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done

if fix IP Address

$ sudo nano /etc/network/interfaces

auto enp3s0
iface enp3s0 inet static
           address 192.168.111.1
           netmask 255.255.255.0
           dns-nameservers 192.168.111.1
           dns-nameservers 8.8.4.4
           gateway 192.168.111.100

to

auto eth0
iface eth0 inet static
           address 192.168.111.1
           netmask 255.255.255.0
           dns-nameservers 192.168.111.1
           dns-nameservers 8.8.4.4
           gateway 192.168.111.100



Reboot

$ sudo reboot
$ ifconfig

eth0      Link encap:Ethernet  HWaddr e8:11:32:2d:43:f2  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:211 errors:0 dropped:0 overruns:0 frame:0
          TX packets:211 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:16488 (16.4 KB)  TX bytes:16488 (16.4 KB)

wlan0     Link encap:Ethernet  HWaddr 00:1b:b1:ac:50:4d  
          inet addr:192.168.111.102  Bcast:192.168.111.255  Mask:255.255.255.0
          inet6 addr: fe80::5581:d3e0:8eac:b1d1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:943 errors:0 dropped:0 overruns:0 frame:0
          TX packets:934 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:665249 (665.2 KB)  TX bytes:145824 (145.8 KB)

screenshot-at-2017-01-18-20-45-16

Posted in Linux Mint | Leave a comment

PPTPd Server on Debian

PPTP Server

Install & config

$ sudo aptitude install pptpd

$ sudo nano /etc/pptpd.conf

localip 192.168.222.1
remoteip 192.168.222.100-200,192.168.222.245
$ sudo nano /etc/ppp/pptpd-options

ms-dns 192.168.222.1
ms-dns 8.8.4.4
nobsdcomp

noipx
mtu 1490
mru 1490

username/password for authen

$ sudo nano /etc/ppp/chap-secrets

# Secrets for authentication using CHAP
# client	server	secret			IP addresses
#username  *  users-password  *

username1	*	password1	*
username2	*	password2	*
username3	*	password3	*

Start pptpd

$ sudo /etc/init.d/pptpd restart

PPTP Client

Install & config

$ sudo aptitude install pptp-linux network-manager-pptp
$ sudo nano /etc/ppp/chap-secrets

# Secrets for authentication using CHAP
# client	server	secret			IP addresses
#username  *  users-password  *

username1	PPTP	password1	*

create connection profile

$ sudo nano /etc/ppp/peers/pptp-idc-01

pty "pptp vpn.nanosofttech.com --nolaunchpppd"
name username1
remotename PPTP
require-mppe-128
file /etc/ppp/options.pptp
ipparam pptp-idc-01

set route

$ sudo nano /etc/ppp/ip-up.d/route-ppp0

#!/bin/bash

NET="192.168.222.0/24" # set me
IFACE="ppp0" # set me
#IFACE=$1
route add -net ${NET} dev ${IFACE}
$ sudo chmod +x /etc/ppp/ip-up.d/route-ppp0

connect

$ sudo pppd call pptp-idc-01
$ sudo tail -f /var/log/messages


Jan 16 07:35:03 nano rsyslogd: [origin software="rsyslogd" swVersion="8.4.2" x-pid="766" x-info="http://www.rsyslog.com"] rsyslogd was HUPed
Jan 16 10:09:42 nano kernel: [244207.553651] PPP generic driver version 2.4.2
Jan 16 10:09:42 nano pppd[19949]: pppd 2.4.6 started by adull, uid 0
Jan 16 10:09:42 nano pppd[19949]: Using interface ppp0
Jan 16 10:09:42 nano pppd[19949]: Connect: ppp0  /dev/pts/1
Jan 16 10:09:43 nano pppd[19949]: CHAP authentication succeeded
Jan 16 10:09:43 nano kernel: [244208.758792] PPP MPPE Compression module registered
Jan 16 10:09:43 nano pppd[19949]: MPPE 128-bit stateless compression enabled
Jan 16 10:09:43 nano pppd[19949]: local  IP address 192.168.222.100
Jan 16 10:09:43 nano pppd[19949]: remote IP address 192.168.222.1
$ ifconfig


eth0      Link encap:Ethernet  HWaddr 54:04:a6:cf:1f:67  
          inet addr:192.168.111.101  Bcast:192.168.111.255  Mask:255.255.255.0
          inet6 addr: fe80::5604:a6ff:fecf:1f67/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5797937 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9977493 errors:0 dropped:0 overruns:0 carrier:1
          collisions:0 txqueuelen:1000 
          RX bytes:1849976958 (1.7 GiB)  TX bytes:1540628439 (1.4 GiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:90 errors:0 dropped:0 overruns:0 frame:0
          TX packets:90 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:31086 (30.3 KiB)  TX bytes:31086 (30.3 KiB)

ppp0      Link encap:Point-to-Point Protocol  
          inet addr:192.168.222.100  P-t-P:192.168.222.1  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1486  Metric:1
          RX packets:43 errors:0 dropped:0 overruns:0 frame:0
          TX packets:35 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 
          RX bytes:5727 (5.5 KiB)  TX bytes:4005 (3.9 KiB)


$ route

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.111.1   0.0.0.0         UG    0      0        0 eth0
192.168.111.0   *               255.255.255.0   U     0      0        0 eth0
192.168.222.0   *               255.255.255.0   U     0      0        0 ppp0
192.168.222.1   *               255.255.255.255 UH    0      0        0 ppp0
Posted in Debian, Linux Mint | Leave a comment

TestDisk recovery unknow partition

testdisk recovery unknow partition

$ sudo aptitude install testdisk
$ sudo testdisk

http://www.cgsecurity.org/wiki/TestDisk

Posted in Linux Mint | Leave a comment

UIF (Universal Image File) to ISO on mint

 

$ sudo aptitude install uif2iso
$ uif2iso NanoSoftTech.uif NanoSoftTech.iso

 

UIF2ISO 0.1.7
by Luigi Auriemma
e-mail: aluigi@autistici.org
web:    aluigi.org
- open NanoSoftTech.uif

  file size    000000002a3db810
  version      1
  image type   9
  padding      0
  sectors      371319
  sectors size 2048
  blhr offset  000000002a3d52a8
  blhr size    25960
  hash         e6765a37cc439911f377dbeb51262110
  others       00000040 00000470 00 00 00 00 00000000

- disable any encryption
- raw or mixed type image
- BIN/CUE output image format
- create NanoSoftTech.bin
- generate an "experimental" CUE file for more compatibility on various systems
- create NanoSoftTech_uif2iso.cue
- BIN name stored in the UIF file: C:\Program Files\BitComet\Downloads\NanoSoftTech-EDGEISO\esps1601.bin
- CUE name stored in the UIF file: C:\Program Files\BitComet\Downloads\NanoSoftTech-EDGEISO\esps1601.cue
- create NanoSoftTech.cue
- start unpacking:
  100%
- 0x000000002d53b470 bytes written
- finished
Posted in Uncategorized | Leave a comment

Jawi on Mint جاوي لينوق مينت

Install Jawi Keyboard Layout

jawi-keyboard-layout-diagram

http://jawi4linux.weebly.com/downloads.html

$wget https://launchpad.net/jawi/1.0.7/1.0.7/+download/jawi-keyboard_1.0.7-1ubuntu2_all.deb
$dpkg -i jawi-keyboard_1.0.7-1ubuntu2_all.deb

screenshot-at-2016-11-28-16-03-05

$setxkbmap us,th,ms
$sudo nano /etc/default/keyboard

XKBLAYOUT="us,th,ms"

screenshot-at-2016-11-28-16-53-42

Posted in Uncategorized | Leave a comment