2020-08-13

Raspberry Pi

Download image

https://www.raspberrypi.org/downloads/

unzip xxx.zip

dd if=xxx.img of=/dev/sdx bs=100M

-- or --

unzip -p xxx.zip  | sudo dd of=/dev/sdx bs=100M

* first time boot will resize root partition

  cmdline.txt:

   init=/usr/lib/raspi-config/init_resize.sh   


config:

raspi-config


/boot/config.txt

https://www.raspberrypi.org/documentation/configuration/config-txt/boot.md

# GPU Memory
gpu_mem=512

disable_overscan=1

# Disable rainbow image at boot
disable_splash=1

/boot/cmdline.txt
logo.nologo

# change boot message to tty3 (no boot message)
console=tty3



Boot splash:
/usr/share/plymouth/themes/pix/splash.png

default user/password: pi/raspberry

No Mouse Pointer / no screensaver:
/etc/lightdm/lightdm.conf
[SeatDefaults]
xserver-command=X -s 0 -dpms -nocursor

change background:
DISPLAY=:0.0 pcmanfm --set-wallpaper xxx.jpg

Error: desktop manager is not active
run from cron:
export DISPLAY=:0.0
export XAUTHORITY=/home/pi/.Xauthority # ???
export XDG_RUNTIME_DIR='/run/user/1000'

pcmanfm --set-wallpaper xxx.jpg

pcmanfm --reconfigure --display=:0.0


change IP:

/etc/dhcpcd.conf
interface eth0
static ip_address=192.168.0.4/24    
static routers=192.168.0.254
static domain_name_servers=192.168.0.254 8.8.8.8

profile ssid_xxx
    ipv4only
    static ip_address=192.168.4.2/24

ssid xxx
   fallback ssid_xxx

ssid yyy
   static ip_address=192.168.4.3/24


Wifi:
/etc/wpa_supplicant/wpa_supplicant.conf
network={
   ssid="xxx"
   psk="XXX"
   key_mgmt=WPA-PSK
   priority=5
}
network={
   ssid="yyy"
   psk="yyy"
   key_mgmt=WPA-PSK
   scan_ssid=1
   priority=3
}
network={
   ssid="zzz"
   key_mgmt=NONE
   priority=7
}

Disable service:
sudo update-rc.d boa disable

sudo apt update
sudo apt-get install apache2


/etc/apache2/mods-enabled
sudo ln -s ../mods-available/auth_basic.load
sudo ln -s ../mods-available/cgi.load

/etc/apache2/apache2.conf
<Directory "/usr/local/apache2/htdocs/somedir">
    Options +ExecCGI
</Directory>

AddHandler cgi-script .cgi .pl

/etc/apache2/sites-enabled/999-my.conf
<Location "/">
    AuthType basic
    AuthName "private area"
    AuthBasicProvider  file
    AuthUserFile    "/etc/apache2/password/htpasswd"
    Require            valid-user
</Location>

sudo systemctl restart apache2
sudo systemctl status apache2

virtual wlan interface
https://www.suse.com/c/creating-virtual-wlan-interfaces/

modprobe mac80211_hwsim
# wlan1 & wlan2 will be created

/etc/modules
mac80211_hwsim
* auto load

routed wireless access point

sudo apt install hostapd

sudo systemctl unmask hostapd
sudo systemctl enable hostapd

sudo apt install dnsmasq

sudo DEBIAN_FRONTEND=noninteractive apt install -y netfilter-persistent iptables-persistent

/etc/dhcpcd.conf
profile static_wlan0
static ip_address=192.168.4.1/24

interface wlan0
    env ifwireless=0
    fallback static_wlan0
    static ip_address=192.168.4.1/24
    nohook wpa_supplicant

* fix static ip/nohook not work

/etc/sysctl.d/routed-ap.conf
net.ipv4.ip_forward=1

sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo netfilter-persistent save

sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig

/etc/dnsmasq.conf
# Listening interface
interface=wlan0

dhcp-range=192.168.4.2,192.168.4.20,255.255.255.0,24h
# Pool of IP addresses served via DHCP
# Local wireless DNS domain
domain=wlan
address=/gw.wlan/192.168.4.1
# Alias for this router

sudo rfkill unblock wlan

/etc/hostapd/hostapd.conf
country_code=GB
interface=wlan0
ssid=NameOfNetwork
hw_mode=g
channel=7
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=AardvarkBadgerHedgehog
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP


*** dnsmasq make resolv.conf nameserver -> 127.0.0.1

resolvconf -i
resolvconf -d lo.dnsmasq


Captive Portal
https://captivebehavior.wballiance.com/

android:
http://connectivitycheck.gstatic.com/generate_204
ios:
http://captive.apple.com/hotspot-detect.html
mi:
http://connect.rom.miui.com/generate_204
http://developers.google.cn/generate_204
samsung:
?

Web Server:
ln -s index.html generate_204
ln -s index.html hotspot-detect.html

/etc/dnsmasq.conf
# ALL domain -> 192.168.4.243
address=/#/192.168.4.243

redirect any tcp port 80/443 from interface wlan0 to 192.168.4.243
iptables -t nat -I PREROUTING -i wlan0 -p tcp --dport 80 -j DNAT --to 192.168.4.243:80
iptables -t nat -I PREROUTING -i wlan0 -p tcp --dport 443 -j DNAT --to 192.168.4.243:443




Video player: OpenMAX H.264 GPU decode (pi 3 test youtube 1080@60) 
omxplayer
    -o both    audio 3.5mm & hdmi
    -o local    audio 3.5mm
    -o hdmi    audio hdmi
    -o alsa[:device]    bluetooth, etc
    --timeout 0    (fix m3u8 live stream stop)
    --win x1,y1,x2,y2    geometry
    --crop x1,y1,x2,y2
    --layer n    Set video render layer number (higher numbers are on top) (multi omxplayer)

web server: boa
sudo apt-get install boa

# add video/audio play permission to web cgi (user: www-data)
sudo usermod -a -G video www-data
sudo usermod -a -G audio www-data

/etc/boa/boa.conf
AddType application/x-httpd-cgi cgi

/etc/sudoers.d/power
# cgi to reboot/poweroff
www-data ALL = NOPASSWD:/sbin/reboot, /sbin/poweroff

sudo service boa start


Photo Viewer: feh

Launch bar logo
sudo cp xxx.png /usr/share/icons/PiX/16x16/places/rpi-logo.png
sudo cp xxx.png /usr/share/icons/PiX/24x24/places/rpi-logo.png
sudo cp xxx.png /usr/share/icons/PiX/32x32/places/rpi-logo.png
sudo cp xxx.png /usr/share/icons/PiX/48x48/places/rpi-logo.png

Raspberry logo
sudo cp yyy.png /usr/share/icons/hicolor/32x32/apps/rpi.png
sudo cp yyy.png /usr/share/icons/PiX/16x16/apps/rpi.png
sudo cp yyy.png /usr/share/icons/PiX/24x24/apps/rpi.png
sudo cp yyy.png /usr/share/icons/PiX/32x32/apps/rpi.png
sudo cp yyy.png /usr/share/icons/PiX/48x48/apps/rpi.png


/etc/rc.local not execute at first time power on
rc.local run before dependency service & got error
 -> check & wait for the service ready

systemctl list-units --no-pager

$ systemctl status rc.local

Warning: The unit file, source configuration file or drop-ins of rc-local.service changed on disk. Run 'systemctl daemon-reload' to reload units.

sudo systemctl daemon-reload


poweroff / reboot slow
/etc/systemd/system.conf
   DefaultTimeoutStopSec=5s



2020-07-25

PUBG Mobile - OASIS FRESH All 46 Drinks Recipes 絕地求生 飲品配方



SSSSFJSSCSCCJJC
SSFSJCSFCJJJFJC
SSJSJJSFFJJFJFF
JCCCCCSSJSJJSFF
FFFSSSSFJSSCSCC
FCCSSFSJCSFCJJJ
JJFJFFFCCSSJ-IJJC-I
JJCJCCCCCSJJ-ICCC-I
FJCFFFSSS-ISCC-IFFC
FFC

SSyrup蜂蜜甜露
FFlavoring咖啡苦酒
JSour Juice檸檬汁酸汁
CChili Sauce辣椒辣素
IIce
Shake Gently輕搖轻摇
Shake Quickly快搖快摇



2020-07-23

Tiny Core Linux UTF-8 support

getlocale.tcz - load to re-config locale with en_US.UTF-8 & gen mylocale.tcz

mylocale.tcz

add boot command:
    lang=en_US.UTF-8


.profile:
export LC_CTYPE=en_US.UTF-8
Fix google chrome chinese support
export G_FILENAME_ENCODING=UTF-8


* Fix gnome-terminal crash
 # Locale not supported by C library.
        Using the fallback 'C' locale.
 # Error constructing proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Error calling StartServiceByName for org.gnome.Terminal:  GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.gnome.Terminal exited with status 9

Error constructing proxy for org.gnome.Terminal: /org/gnome/Terminal/Factory0: 
Error calling StartServiceByName for org.gnome.Terminal:
GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: 
Process /usr/lib/gnome-terminal/gnome-terminal-server exited with status 8

2019-04-22

[SFC/SNES] 超級瑪莉奧世界 (Super Mario World) 無限飛行/多段跳/不限時 金手指

無限跳/多段跳 unlimited jump

    DA23-DF04
    DA32-0F67
    DA28-AFAF
    6D2B-D4D4 (多段跳)
    DBE2-A46F (飛時畫面同步上下移動)
    DD26-D7D4 (不需羽毛)

飛不用等加速

    DD2F-04D4
    * Bug: 通關動畫卡死

不限時 unlimited time

    6D6E-0767

不死

    DDE5-04DF
    C9EC-0DDF (保持狀態)

道具使用後不消失 unlimited backup item

    C26D-D766
    * Select

強制重玩已過關卡 replay close boss

    DDB9-042D
    DDB9-079D

強制退出 force exit

    DDCD-6F6D
    * Start -> Select

P Mode

    DD80-6429

Boss橋不斷開

    6D2F-A7D2

高度不變

    6D2B-D4D4


2019-04-03

[SFC/SNES] 洛克人X (Rockman X) 空中波動拳/空中衝剌 金手指

ロックマンX
洛克人X
Mega Man X

2653
3848
7587


波動拳/Hadouken anytime (Jumping / no Upgrades / low blood / 空中波動拳)

    DDC3-4DD0
    ↓↘→ Y
    * may cause bug1 / 可引致bug1 (無敵)

[SFC] 洛克人X 空中波動拳 Rockman X Air Hadouken



波動拳裝置 不需檢查 E/滿血/裝備等

    6DAB-C4F3
    43AB-C493
[SFC] 洛克人X 波動拳不需滿足條件


波動拳簡化

   D1C5-44D0
    ↓ Y

Power Shoot Level 1->3

    DFB6-4DD1

Air Dash / 空中衝剌

    DDBA-3469
    6D65-1F01
    * can JUMP while Dash / 在衝剌時可跳(多段跳效果)
    * may cause bug1

[SFC] 洛克人X空中衝剌  Rockman X Air Dash



 多段跳 unlimited jump

 空中長衝剌+波動拳 air dash + Air Hadouken


[fix bug1] 解除bug1無敵效果(啟動後再取消便回復正常)

    DD65-CFD0

Long Dash / 長衝剌

    6D6B-1FA1

Dash without updated

    DDBB-3409

ignore VAVA low blood check (1st)

    DD2F-34A2

ignore VAVA low blood check (2nd)

    423A-4FA3
    3A3A-44D3

全場攻擊

    DDB1-3494

自動拿道具

    DD3A-4FAB

同一水平面 自動拿道具/攻擊/被攻擊

    DDB8-4427

強制攻擊有防禦的

    6DB0-C4F7

無敵

6DB4-3D24


穿過膠囊

6DB3-4F97

Weapon

    8B2F-14A4
    8B29-17D4
    8B2C-1404
    82BE-4FA9
    82BF-1409
    6D62-4F0B

Blood

    C2B9-1497 (Most)
    C2B1-3DB7 (Boomer Kuwanger's attack) (Bug: disable when Fall down)
    C2AD-4401 (Launcher Octopuld's attack)

Demo



Icy Penguigo



Storm Eagleed



Burnin' Noumander



Boomer Kuwanger



Launcher Octopuld



Sting Chameleao



Spark Mandriller



Armor Armarge






2019-03-26

GRUB2 multiboot ISO 2018


GRUB2 multiboot ISO (2014)


Linux ISO default


Arch Linux  2019.01.01


Cent OS  7 1810


clonezilla 2.5.6-22



Debian 9.6.0


FreeBSD 12.0


Fedora 29-1.2


Gentoo 20160704


Kali 2018.4


Knoppix V8.2-2018-05-10


kubuntu 18.10


Linuxmint 19.1


LMDE 3-201808


lubuntu 18.10


NST 28-10439


Pentoo 2018.0_RC8


openSUSE 15.0


slitaz 2019.01.06


Ubuntu 18.10


UbuntuStudio 18.10


Win10 (partition NOT ISO)

2019-03-09

[SFC/SNES] 46億年物語 進化/空中游泳 金手指

E.V.O.: Search for Eden

EVO Free
    6D25-64AF
P
    5228-6F6F

Green Free
    6DCA-6402

Green unlimit time
    6D64-A4A1

1 Hit KO
    DD6C-AD92

Blood
    C96E-0D2B

Easy Mode
    6D6C-6798
    DD6F-AFF8
    6D6F-A428
    6D60-AD98
    6D60-A728

Swim Mode(Jump to swim)
    6DAF-DD00
    10AF-DD60
空中游泳
Jump unlimit eat
   3CC0-6D09
   3CC0-6D69
   3CC0-6DA9



http://db.gamefaqs.com//console/snes//file/evo_fort_bird_man.gif
http://shrines.rpgclassics.com/snes/evo/pics/maps/edenmap.gif
http://shrines.rpgclassics.com/snes/evo/pics/maps/cloudmap.gif
http://shrines.rpgclassics.com/snes/evo/pics/maps/mhmap.gif
http://shrines.rpgclassics.com/snes/evo/pics/maps/rogonmap.gif