วันอาทิตย์ที่ 2 ธันวาคม พ.ศ. 2561

วันอังคารที่ 24 ตุลาคม พ.ศ. 2560

Using to crunch generate number password

   13  crunch
   14  crunch --help
   15  man crunch
   16  crunch 10 10 -t 09%%%%%%%% -o /root/09x.txt
   17  ls
   18  zip 09x.txt
   19  zip 09x.txt 09x.txt.zip
   20  zip 09x.txt.zip 09x.txt
   21  crunch 10 10 -t 08%%%%%%%% -o /root/08x.txt
   22  zip 08x.txt.zip 08x.txt
   23  history

วันจันทร์ที่ 9 ตุลาคม พ.ศ. 2560

วันพุธที่ 20 กันยายน พ.ศ. 2560

Linux youtube-dl with Playlist

[Download all in Playlist]
youtube-dl --extract-audio --audio-format mp3 --audio-quality 0 -ci https://www.youtube.com/playlist?list=PLtkobr6wagHU67Ajtmmp31UTVcabMByK-
[Download each file]
youtube-dl --extract-audio --audio-format mp3 --audio-quality 0 https://www.youtube.com/watch?v=JGwWNGJdvx8

วันพุธที่ 13 กันยายน พ.ศ. 2560

HOW TO FIX SMALL SCREEN TEAMVIEWER HOST ON RASPBERRY PI????

HOW TO FIX SMALL SCREEN TEAMVIEWER HOST ON RASPBERRY PI???? ++++++++++++++++++++++++++++ FOLLOWING THIS STEP:
1, EDIT config.txt in boot, do sudo nano /boot/config.txt
2, Remove # before: === disable_ovescan === framebuffer_width === framebuffer_height change resolution to 1280x720 Do, Ctrl+O, enter to save.
3, Reboot 4, Waiting and connecting to your Pi with Teamviewer on your PC again. ===========THE BUG was fixed============ ENJOY HAVE A NICE DAY!!!

speedtest-csv

http://www.smartdomotik.com/2015/04/03/how-to-schedule-speedtest-from-linux-server/

[GUIDE] Raspbian Lite with PIXEL/LXDE/XFCE/MATE/i3 GUI

https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=133691

วันจันทร์ที่ 24 เมษายน พ.ศ. 2560

[MKT] Block facebook 25 APR 2017

1. create address list in /ip firewall address list
     1.1 address facebook.com
     1.2 define name Fb
Result :
/ip firewall address-list
add address=facebook.com list=fb

2.  create firewall filter rules
/ip firewall filter
add action=drop chain=forward comment="FW Rule Block FB testing" \
    dst-address-list=fb dst-address-type="" src-address=10.0.0.4
  ***src-addr may be host or network***


วันศุกร์ที่ 31 มีนาคม พ.ศ. 2560

ทำระบบ Notify ง่ายๆ ผ่าน Line API แจ้งเมื่อมีคน login (SSH) เข้า server เรา Linux

nano /root/.bash_profile

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

servIP=`ifconfig eth0 | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*'`
REMOTE_USER=`whoami`
REMOTE_IP=`who am i`
CUTIP=${REMOTE_IP%)*}
CUTIP=${CUTIP##*(}

curl -X POST -H 'Authorization: Bearer {LineTOken}' -F 'message=Server "'"$servIP"'"
have SSH login via IP "'"$CUTIP"'" by user "'"$REMOTE_USER"'"
 ' https://notify-api.line.me/api/notify

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH

unset USERNAME



วันเสาร์ที่ 6 สิงหาคม พ.ศ. 2559

restore RPI progrss diague

(pv -n /media/pichi/Soulkeeper2/RPI2_home_backup_02062016.img | dd of=/dev/sdb bs=128M conv=notrunc,noerror) 2>&1 | dialog --gauge "Running dd command (cloning), please wait..." 10 70 0

วันจันทร์ที่ 11 กรกฎาคม พ.ศ. 2559

ssh on startup after install raspbian

ในกรณีที่ไม่มีจอ mouse keyboard
mount sdcard ใน linux
   1.  nano /etc/rc2.d/ssh/K??ssh to /etc/rc2.d/ssh/S02ssh
หรือ 
1) edit /etc/rc.local file (sudo nano /etc/rc.local)
2) just above last command (exit 0) add a line to start ssh (/etc/init.d/ssh start)
3) save & exit


ไม่รู้อันไหนใช้ได้ แต่ทำทั้ง 2 อย่าง ssh ได้

วันอาทิตย์ที่ 22 พฤษภาคม พ.ศ. 2559

control Lighting room with php GPIO

sudo apt-get install apache2 php5
sudo apt-get install git-core
git clone git://git.drogon.net/wiringPi 
cd wiringPi
./build
 
Test by using :
gpio readall 
then 
 
nano /etc/var/www/html/gpio.php
copy below code :
 
 ------------------------------------------------------------
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>LED Control</title>
</head>
        <body>
        LED Control:
         <form method="get" action="gpio.php">
                 <input type="submit" value="ON" name="on">
                 <input type="submit" value="OFF" name="off">
         </form>
         <?php
         $setmode17 = shell_exec("/usr/local/bin/gpio -g mode 17 out");
         if(isset($_GET['on'])){
                 $gpio_on = shell_exec("/usr/local/bin/gpio -g write 17 1");
                 echo "LED is on";
         }
         else if(isset($_GET['off'])){
                 $gpio_off = shell_exec("/usr/local/bin/gpio -g write 17 0");
                 echo "LED is off";
         }
         ?>
         </body>
 </html>
-------------------------------------------------------------
 ต่อไฟให้ relay ตามนี้ 
 
 
 
 
Code จริง  ใช้ขา pin 38 ,40 เท่ากับ GPIO ขา 20,21
 
 
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Room Salmon Lighting</title>
</head>
        <body>
        LED [1]               LED [2]
         <form method="get" action="gpio.php">
                 <input type="submit" value="ON" name="on">
                 <input type="submit" value="OFF" name="off">
         <form method="get" action="gpio.php">
                 <input type="submit" value="ON1" name="on1">
                 <input type="submit" value="OFF1" name="off1">
          </form>
         <?php
         $setmode20 = shell_exec("/usr/local/bin/gpio -g mode 20 out");
         if(isset($_GET['on'])){
                 $gpio_on = shell_exec("/usr/local/bin/gpio -g write 20 1");
                 echo "LED is on";
         }
         else if(isset($_GET['off'])){
                 $gpio_off = shell_exec("/usr/local/bin/gpio -g write 20 0");
                 echo "LED is off";
         }
         $setmode21 = shell_exec("/usr/local/bin/gpio -g mode 21 out");
         if(isset($_GET['on1'])){
                 $gpio_on = shell_exec("/usr/local/bin/gpio -g write 21 1");
                 echo "LED is on1";
         }
         else if(isset($_GET['off1'])){
                 $gpio_off = shell_exec("/usr/local/bin/gpio -g write 21 0");
                 echo "LED is off1";
         }

         ?>
         </body>
 </html>
 

----