Monday, October 30, 2017

macbook airport

cd /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources
sudo ./airport en0 -I

Monday, October 23, 2017

dump mtd block in linux kernel

uboot$ smem
kernel$ cat /proc/mtd
kernel$ ls -l /dev/
kernel$ hexdump -C /dev/mtdblock7 -s 4096 -n 1024
(offset 4096 == 0x1000, len = 1024)

dd if=/dev/mtdblock7 of=/root/data.bin count=64 bs=1024

dd if=/dev/mtd7 of=/root/data.bin bs=32 count=377 skip=128

bs: block size to read at once
count: number of 'bs' to run
* total size = bs * count = 64KB


* flash erase on kernel
kernel$flash_erase /dev/mtdblock7

* flash copy on kernel
kernel$ flashcp u-boot-env /dev/mtdblock7

trace the linux daemon log (running in background)

tail -F /var/log/messages

Thursday, October 12, 2017

android crash report

c:>adb bugreport 2>&1 | tee bugreport.txt
(be patient, it takes time)

Tuesday, October 10, 2017

hostapd.conf


--- default:: hostapd-etsi-vht80.conf
driver=nl80211
logger_syslog=127
logger_syslog_level=2
logger_stdout=127
logger_stdout_level=2
country_code=DK
ieee80211d=1
ieee80211h=1
hw_mode=a
channel=52

ieee80211n=1
ht_capab=[HT40+][LDPC][SHORT-GI-20][SHORT-GI-40][TX-STBC][RX-STBC1][DSSS_CCK-40]
vht_oper_chwidth=1
vht_oper_centr_freq_seg0_idx=58
ieee80211ac=1
vht_capab=[RXLDPC][SHORT-GI-80][TX-STBC-2BY1][SU-BEAMFORMER][SU-BEAMFORMEE][MU-BEAMFORMER][RX-ANTENNA-PATTERN][TX-ANTENNA-PATTERN][MAX-MPDU-11454][RX-STBC-1][MAX-A-MPDU-LEN-EXP7]

interface=wlan2
ctrl_interface=/var/run/hostapd
disassoc_low_ack=0
preamble=1
wmm_enabled=1
ignore_broadcast_ssid=0
uapsd_advertisement_enabled=1
auth_algs=1
wpa=0
ssid=5G-DFS
bridge=br-lan

***
802.11ac may have one of three lengths: 3,895 bytes, 7,991 bytes, or 11,454 bytes.
but hostapd accept only 7991 and 11454.
[MAX-MPDU-7991]
[MAX-MPDU-11454]

The maximum length of an A-MPDU is controlled by the value of a field called the Maximum A-MPDU Length Exponent, which describes the maximum length of an A-MPDU by the formula
2^(13+Exponent) - 1 bytes.
802.11ac allows values for the exponent ranging from 0 to 7, which allows the maximum A-MPDU length to range from 8 KB to 1 MB.
[MAX-A-MPDU-LEN-EXP7] ~ [MAX-A-MPDU-LEN-EXP1]

Monday, October 9, 2017

android alarm dump


adb shell dumpsys alarm

alarmManager.cancel(pendingIntent) and pendingIntent.cancel()

Tuesday, October 3, 2017

sharing files on windows among windows, linux, and mac

* using samba protocol
* set-up folder sharing on windows

* on Linux
* install cifs-utils
sudo apt install cifs-utils

* PETER-DESKTOP is to be added to /etc/hosts

* add credential info
----- credential info -----
cat /home/peter/.smbcredentials
username=Peter
password=Password

peter@peter-linux-dell:~$ ls -al .smbcredentials  (root, 0600)
-rw------- 1 root root 187 Oct  3 15:16 .smbcredentials
-------------------------------------------------------------------------------

* add this line to /etc/fstab
----- /etc/fstab -----
//PETER-DESKTOP/shares /home/peter/shares cifs auto,iocharset=utf8,uid=1000,credentials=/home/peter/.smbcredentials,file_mode=0775,dir_mode=0775 0 0
-------------------------------------------------------------------------------