2014-07-29

Slitaz -- screenshot

scrot: A screen capture utility

Take a screenshot of the full screen with scrot when Print are pressed
Take a screenshot of the current window with scrot when Alt+Print are pressed


1.
tux@slitaz:~$ sudo tazpkg -gi scrot


2.
tux@slitaz:~$ scrot --help | grep -A 3 Example
  Example:
          scrot '%Y-%m-%d_$wx$h_scrot.png' -e 'mv $f ~/images/shots/'
          Creates a file called something like 2000-10-30_2560x1024_scrot.png
          and moves it to your images directory.


3.
tux@slitaz:~$ grep -A 3 Print .config/openbox/rc.xml
  <!-- Take a screenshot of the full screen with scrot when Print are pressed -->
  <keybind key="Print">
    <action name="Execute"><command>scrot '%Y%m%d-%s.png'</command></action>
  </keybind>
  <!-- Take a screenshot of the current window with scrot when Alt+Print are pressed -->
  <keybind key="A-Print">
    <action name="Execute"><command>scrot -b -u '%Y%m%d-%s.png'</command></action>
  </keybind>

tux@slitaz:~$

2014-07-28

Slitaz -- wpa / nl80211


nl80211: 'nl80211' generic netlink not found
Failed to initialize driver 'nl80211'                [ Failed ]


1.
root@slitaz:/home/tux# /etc/init.d/wpa_supplicant start
Starting wpa_supplicant deamon: wpa_supplicant... Successfully initialized wpa_supplicant
nl80211: 'nl80211' generic netlink not found
Failed to initialize driver 'nl80211'                [ Failed ]


2.
root@slitaz:/home/tux# modprobe mac80211

root@slitaz:/home/tux# lsmod | head -5
Module                  Size  Used by    Tainted: G 
r8712u                115832  0
mac80211              161375  0
cfg80211              117342  1 mac80211
rfkill                 10155  2 cfg80211


3.
root@slitaz:/home/tux# modinfo mac80211
filename:       /lib/modules/3.2.53-slitaz/kernel/net/mac80211/mac80211.ko.xz
license:        GPL
description:    IEEE 802.11 subsystem
depends:        cfg80211
intree:         Y
vermagic:       3.2.53-slitaz SMP mod_unload 386
parm:           ieee80211_default_rc_algo:Default rate control algorithm for mac80211 to use (charp)
parm:           max_nullfunc_tries:Maximum nullfunc tx tries before disconnecting (reason 4). (int)
parm:           max_probe_tries:Maximum probe tries before disconnecting (reason 4). (int)
parm:           probe_wait_ms:Maximum time(ms) to wait for probe response before disconnecting (reason 4). (int)
root@slitaz:/home/tux#

Slitaz -- wpa / wext


-D = driver name (can be multiple drivers: nl80211,wext)

example:
wpa_supplicant -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf


1.
root@slitaz:/home/tux# wpa_supplicant -help | grep -A 3 drivers:
drivers:
nl80211 = Linux nl80211/cfg80211
wext = Linux wireless extensions (generic)
wired = Wired Ethernet driver
--
-D = driver name (can be multiple drivers: nl80211,wext)
-e = entropy file
-g = global ctrl_interface
-G = global ctrl_interface group


2.
Update wpa_supplicant (2.1) And use /etc/wpa
http://hg.slitaz.org/wok/raw-rev/62082fa37457

diff -r f2f0afdddde7 -r 62082fa37457 wpa_supplicant/receipt
--- a/wpa_supplicant/receipt Sat Feb 15 15:38:27 2014 +0100
+++ b/wpa_supplicant/receipt Sat Feb 15 19:55:40 2014 +0100
@@ -1,7 +1,7 @@
# SliTaz package receipt.

PACKAGE="wpa_supplicant"
-VERSION="1.1"
+VERSION="2.1"
CATEGORY="utilities"
SHORT_DESC="WPA Supplicant with support for WPA and WPA2"
MAINTAINER="0dddba11@googlemail.com"
@@ -57,20 +57,22 @@
$src/wpa_supplicant/dbus/dbus-wpa_supplicant.conf \
$fs/etc/dbus-1/system.d/wpa_supplicant.conf

- # Startup script and cleaned up wpa_supplicant.conf
- cp -a stuff/etc $fs
- # dont copy the original
- # cp -a $src/$PACKAGE/wpa_supplicant.conf $fs/etc
+ # Startup script and cleaned up wpa_empty.conf
+ cp -a $stuff/etc $fs
+ cp -a $src/$PACKAGE/wpa_supplicant.conf $fs/etc/wpa
}


3.
root@slitaz:/home/tux# head -15 /etc/init.d/wpa_supplicant
#!/bin/sh
# /etc/init.d/wpa_supplicant: Start, stop and restart wpa_supplicant deamon
# on SliTaz, at boot time or with the command line.
#
# To start daemon at boot time, just put the right name in the $RUN_DAEMONS
# variable of /etc/rcS.conf and configure options with /etc/daemons.conf.
#
. /etc/init.d/rc.functions
. /etc/daemons.conf

NAME=wpa_supplicant
DESC="wpa_supplicant deamon"
DAEMON=/usr/bin/wpa_supplicant
OPTIONS=$WPA_OPTIONS
PIDFILE=/var/run/wpa_supplicant.pid


4.
root@slitaz:/home/tux# tail -2 /etc/daemons.conf
# wpa_supplicant daemon options
WPA_OPTIONS="-B -u -D wext -P /var/run/wpa_supplicant.pid -c /etc/wpa/wpa.conf -i $(. /etc/network.conf ; echo $WIFI_INTERFACE)"


5.
root@slitaz:/home/tux# ps | grep wpa
1675 root 0:00 /usr/bin/wpa_supplicant -B -u -D wext -P /var/run/wpa_supplicant.pid -c /etc/wpa/wpa.conf -i wlan0
1955 root 0:00 grep wpa
root@slitaz:/home/tux#

Slitaz -- wpa


Successfully initialized wpa_supplicant
wlan0: Failed to initialize driver interface


1.
root@slitaz:/home/tux# /etc/init.d/wpa_supplicant start
Starting wpa_supplicant deamon: wpa_supplicant... Successfully initialized wpa_supplicant
wlan0: Failed to initialize driver interface [ Failed ]


2.
root@slitaz:/home/tux# dmesg | tail -15
usbcore: deregistering interface driver r8712u
usb 2-6: reset high-speed USB device number 4 using ehci_hcd
r8712u: Driver unloaded
r8712u: module is from the staging directory, the quality is unknown, you have been warned.
r8712u: DriverVersion: v7_0.20100831
r8712u: register rtl8712_netdev_ops to netdev_ops
r8712u: USB_SPEED_HIGH with 4 endpoints
r8712u: Boot from EFUSE: Autoload OK
r8712u: CustomerID = 0x0010
r8712u: MAC Address from efuse = c8:60:00:xx:xx:xx
r8712u: Loading firmware from "rtlwifi/rtl8712u.bin"
usbcore: registered new interface driver r8712u
r8712u: 1 RCR=0x153f00e
r8712u: 2 RCR=0x553f00e
ADDRCONF(NETDEV_UP): wlan0: link is not ready
root@slitaz:/home/tux#


3.
root@slitaz:/home/tux# lsmod | head -5
Module Size Used by Tainted: G
r8712u 115832 0
mac80211 161375 0
cfg80211 117342 1 mac80211
rfkill 10155 2 cfg80211
root@slitaz:/home/tux#


4.
root@slitaz:/home/tux# wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf &
root@slitaz:/home/tux# Successfully initialized wpa_supplicant


5.
root@slitaz:/home/tux# dmesg | tail
r8712u: Loading firmware from "rtlwifi/rtl8712u.bin"
usbcore: registered new interface driver r8712u
r8712u: 1 RCR=0x153f00e
r8712u: 2 RCR=0x553f00e
ADDRCONF(NETDEV_UP): wlan0: link is not ready
ADDRCONF(NETDEV_UP): wlan0: link is not ready
ADDRCONF(NETDEV_UP): wlan0: link is not ready
ADDRCONF(NETDEV_UP): wlan0: link is not ready
ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
wlan0: no IPv6 routers present


6.
root@slitaz:/home/tux# iwconfig wlan0
wlan0 IEEE 802.11bg ESSID:"slitaz" Nickname:"rtl_wifi"
Mode:Managed Frequency:2.442 GHz Access Point: 30:85:A9:xx:xx:xx
Bit Rate:54 Mb/s Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Encryption key:****-****-****-****-****-****-****-**** Security mode:open
Power Management:off
Link Quality=100/100 Signal level=63/100 Noise level=0/100
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

7.
root@slitaz:/home/tux# ifconfig wlan0
wlan0 Link encap:Ethernet HWaddr C8:60:00:xx:xx:xx
inet addr:192.168.1.32 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::ca60:ff:fexx:xxxx/xx Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:113 errors:0 dropped:81 overruns:0 frame:0
TX packets:12 errors:0 dropped:1 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:14750 (14.4 KiB) TX bytes:1807 (1.7 KiB)