2013-12-02

Vagrant / Vagrantbox.es


Vagrant

Development environments made easy.
Create and configure lightweight, reproducible, and portable development environments.

Vagrant is a tool for building complete development environments. With an easy-to-use workflow and focus on automation, Vagrant lowers development environment setup time, increases development/production parity, and makes the "works on my machine" excuse a relic of the past.


Vagrantbox.es

Vagrant is an amazing tool for managing virtual machines via a simple to use command line interface. With a simple vagrant up you can be working in a clean environment based on a standard template.
These standard templates are called base boxes, and this website is simply a list of boxes people have been nice enough to make publicly available.
[..]

Available Boxes

To use the available boxes just replace {title} and {url} with the information in the table below.
 $ vagrant box add {title} {url}
 $ vagrant init {title}
 $ vagrant up 
The list of boxes was last updated on October 25th, 2013.

NameProviderURLSize
CentOS 6.4 amd64 for vagrant-lxc with Puppet 3.3.1 Vagrant-LXC https://dl.dropboxusercontent.com/s/eukkxp5mp2l5h53/lxc-centos6.4-2013-10-24.box 251M
Debian Squeeze amd64 (Puppet 3.2.3, LXC, 2013.07.27) Vagrant-LXC https://dl.dropboxusercontent.com/u/67225617/lxc-vagrant/lxc-squeeze64-puppet3-2013-07-27.box 106.17MB
Debian Squeeze amd64 (Puppet 3.2.3, LXC, 2013.07.27) Vagrant-LXC https://dl.dropboxusercontent.com/u/67225617/lxc-vagrant/lxc-squeeze64-puppet3-2013-07-27.box 106.17MB
Debian Squeeze amd64 (Puppet 3.2.3, LXC, 2013.07.27) Vagrant-LXC https://dl.dropboxusercontent.com/u/67225617/lxc-vagrant/lxc-squeeze64-puppet3-2013-07-27.box 106.17MB
Debian Wheezy amd64 (Puppet 3.2.3, LXC, 2013.07.27) Vagrant-LXC https://dl.dropboxusercontent.com/u/67225617/lxc-vagrant/lxc-wheezy64-puppet3-2013-07-27.box 102.5MB
Openmandriva2013.0 x86_64 (LXC, 2013.10.21) Vagrant-LXC http://bit.ly/vagrant-lxc-openmandriva2013-0-x86_64-2013-10-21 88MB
Ubuntu 13.04 amd64 for vagrant-lxc with Puppet 3.1.1 Vagrant-LXC http://dl.dropbox.com/u/13510779/lxc-raring-amd64-2013-07-12.box 92M
Ubuntu 12.10 amd64 for vagrant-lxc with Puppet 3.1.1 Vagrant-LXC http://dl.dropbox.com/u/13510779/lxc-quantal-amd64-2013-07-12.box 94M
Ubuntu 12.04 amd64 for vagrant-lxc with Puppet 3.1.1 Vagrant-LXC http://dl.dropbox.com/u/13510779/lxc-precise-amd64-2013-07-12.box 94M
Arch Linux 64 (2013-08-01) VirtualBox https://dl.dropboxusercontent.com/u/31112574/arch64-20130801.box 578MB
Arch Linux 64 (2013-07-26) - Chef 11.6.0 from gem, Ruby from pacman VirtualBox http://iweb.dl.sourceforge.net/project/flowboard-vagrant-boxes/arch64-2013-07-26-chef.box 466.7 MB
CentOS 6.4 i386 Minimal (VirtualBox Guest Additions 4.2.16, Chef 11.6.0, Puppet 3.2.3) VirtualBox http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.4-i386-v20130731.box 459MB
CentOS 6.4 x86_64 Minimal (VirtualBox Guest Additions 4.2.16, Chef 11.6.0, Puppet 3.2.3) VirtualBox http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.4-x86_64-v20130731.box 494MB
Debian Wheezy 7.2 amd64 (VirtualBox Guest Additions 4.3.0) (2013/10/19) VirtualBox https://dl.dropboxusercontent.com/u/197673519/debian-7.2.0.box 295MB
Debian Wheezy 7.2 amd64 (VirtualBox Guest Additions 4.3.0, OpenResty 1.4.3.1) (2013/10/31) (src) VirtualBox https://dl.dropboxusercontent.com/s/odnew2tnliqft9o/debian7-openresty.box 355MB
Fedora 19 x86_64 (Puppet, VirtualBox) VirtualBox https://dl.dropboxusercontent.com/u/86066173/fedora-19.box 400MB
FreeBSD 9.2 x86_64 Minimal (VirtualBox, ZFS) VirtualBox https://wunki.org/files/freebsd-9.2-amd64-wunki.box 226MB
Gentoo 2013.05 amd64 (Chef omnibus 11.4.4, VirtualBox 4.2.12) VirtualBox https://lxmx-vm.s3.amazonaws.com/vagrant/boxes/lxmx_gentoo-2013.05_chef-11.4.4.box 357MB
Gentoo 2013.10.24 amd64 (chef, puppet) on 2013.10.30
[src]
VirtualBox https://dl.dropboxusercontent.com/s/qubuaqiizvfpsyx/gentoo-20131024-amd64.box 416.4 MB
Official Ubuntu 13.10 daily Cloud Image amd64 (Development release, No Guest Additions) VirtualBox http://cloud-images.ubuntu.com/vagrant/saucy/current/saucy-server-cloudimg-amd64-vagrant-disk1.box 309M
Official Ubuntu 13.10 daily Cloud Image i386 (Development release, No Guest Additions) VirtualBox http://cloud-images.ubuntu.com/vagrant/saucy/current/saucy-server-cloudimg-i386-vagrant-disk1.box 309M
CentOS 6.4 x86_64 Minimal VMware Fusion (VMware Tools, Chef 11.4.0, Puppet 3.1.1) VMware https://dl.dropbox.com/u/5721940/vagrant-boxes/vagrant-centos-6.4-x86_64-vmware_fusion.box 545.94MB
Ubuntu 13.10 amd64 for VMWare (with Chef, ruby1.9.3 and vmware-tools) VMWare http://brennovich.s3.amazonaws.com/saucy64_vmware_fusion.box 536M
Ubuntu raring 64 VMWare VMware https://s3.amazonaws.com/life360-vagrant/raring64.box 393MB
[..]
http://www.vagrantbox.es/




Slitaz -- vagrant-slitaz


vagrant-slitaz

Vagrant setup based on Slitaz Linux. Started from base cooking image 8Mb. Built against Virtual Box Guest Addins v4.3.

Benefits

The main one is the small vagrant's box size ~96Mb. Despite this the Slitaz guest OS is equipped with: Apache2.4, php-5.4.13, xdebug-2.2.3, perl-5.12.3, MySql-5.5.27, sqlite3, php-cli, git-1.8.3, composer-2013-10-21, ngrok, phpMyAdmin-3.5.2, openssh-5.9

1.
tux@slitaz:~/vagrant-slitaz-master$ vagrant ssh

Welcome to the Open Source World!

SliTaz GNU/Linux is distributed in the hope that it will be useful,
but with ABSOLUTELY NO WARRANTY.

2.
web@devbox:~$ uname -a
Linux devbox 3.2-slitaz #4 SMP Sun Jan 27 02:10:33 CET 2013 i686 GNU/Linux

3.
web@devbox:~$ free -m
total used free shared buffers
Mem: 1516 273 1242 0 116
-/+ buffers: 157 1359
Swap: 0 0 0

4.
web@devbox:~$ df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 5.8G 471.1M 5.0G 8% /
tmpfs 758.3M 200.0K 758.1M 0% /run
devtmpfs 758.1M 0 758.1M 0% /dev
tmpfs 758.3M 0 758.3M 0% /dev/shm
none 2.9G 1.3G 1.6G 45% /projects
none 2.9G 1.3G 1.6G 45% /projects/www

5.
web@devbox:~$ ls -l /
total 72
drwxr-xr-x 2 root root 4096 Oct 22 20:23 bin/
drwxr-xr-x 4 root root 4096 Oct 22 20:35 boot/
drwxr-xr-x 12 root root 2880 Dec 2 16:06 dev/
drwxr-xr-x 16 root root 4096 Oct 27 20:02 etc/
drwxr-xr-x 3 root root 4096 Oct 25 13:01 home/
-rwxr-xr-x 1 root root 4081 Jan 17 2013 init
drwxr-xr-x 5 root root 4096 Oct 25 08:24 lib/
drwx------ 2 root root 16384 Oct 22 10:25 lost+found/
drwxr-xr-x 5 root root 4096 Oct 22 10:28 media/
drwxr-xr-x 2 root root 4096 Sep 23 13:53 mnt/
drwxr-xr-x 3 root root 4096 Oct 25 12:49 opt/
dr-xr-xr-x 63 root root 0 Dec 2 16:06 proc/
drwxrwxrwx 1 web web 160 Dec 2 16:04 projects/
drwxr-x--- 2 root root 4096 Oct 28 11:48 root/
drwxrwxrwt 8 root root 260 Dec 2 16:06 run/
drwxr-xr-x 2 root root 4096 Oct 25 08:24 sbin/
drwxr-xr-x 12 root root 0 Dec 2 16:06 sys/
drwxrwxrwt 4 root root 4096 Dec 2 16:09 tmp/
drwxr-xr-x 10 root root 4096 Oct 27 20:02 usr/
drwxr-xr-x 10 root root 4096 Dec 2 16:06 var/
web@devbox:~$




2013-12-01

Slitaz -- rolling



slitaz-rolling.iso 2013-Nov-24 01:03:35 42.0M


1
tux@slitaz:~$ uname -a
Linux slitaz 3.2-slitaz #4 SMP Sat Nov 23 16:46:58 CET 2013 i686 GNU/Linux

2.
tux@slitaz:~$ grep 'such file' /var/log/boot.log
grep: /lib/modules/3.2-slitaz/modules.usbmap: No such file or directory
grep: /lib/modules/3.2-slitaz/modules.usbmap: No such file or directory
Setting default mixer volumes... amixer: Mixer attach default error: No such file or directory
amixer: Mixer attach default error: No such file or directory
/usr/sbin/soundconf: line 1080: can't open /lib/modules/3.2-slitaz/modules.pcimap: no such file
/usr/sbin/soundconf: line 1080: can't open /lib/modules/3.2-slitaz/modules.isapnpmap: no such file

3.
tux@slitaz:~$ ls -l /lib/modules/3.2.40-slitaz/
total 1032
drwxr-xr-x 10 root root 200 Nov 23 23:57 kernel
-rw-r--r-- 1 root root 241244 Nov 23 23:54 modules.alias
-rw-r--r-- 1 root root 235317 Nov 23 23:54 modules.alias.bin
-rw-r--r-- 1 root root 8547 Nov 23 16:30 modules.builtin
-rw-r--r-- 1 root root 12194 Nov 23 23:57 modules.builtin.bin
-rw-r--r-- 1 root root 93360 Nov 23 23:54 modules.dep
-rw-r--r-- 1 root root 122861 Nov 23 23:54 modules.dep.bin
-rw-r--r-- 1 root root 103 Nov 23 23:54 modules.devname
-rw-r--r-- 1 root root 71340 Nov 23 16:30 modules.order
-rw-r--r-- 1 root root 131 Nov 23 23:57 modules.softdep
-rw-r--r-- 1 root root 112439 Nov 23 23:54 modules.symbols
-rw-r--r-- 1 root root 138006 Nov 23 23:54 modules.symbols.bin

4.
tux@slitaz:~$ zcat /proc/config.gz | grep -e IP_PNP -e NFS
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
CONFIG_IP_PNP_BOOTP=y
CONFIG_IP_PNP_RARP=y
# CONFIG_USB_FUNCTIONFS is not set
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
# CONFIG_NFS_V4 is not set
# CONFIG_ROOT_NFS is not set
CONFIG_NFSD=m
CONFIG_NFSD_V2_ACL=y
CONFIG_NFSD_V3=y
CONFIG_NFSD_V3_ACL=y
# CONFIG_NFSD_V4 is not set
CONFIG_NFS_ACL_SUPPORT=y
CONFIG_NFS_COMMON=y
# CONFIG_NCPFS_NFS_NS is not set

tux@slitaz:~$ zcat /proc/config.gz | grep CGROUP
CONFIG_CGROUPS=y
# CONFIG_CGROUP_DEBUG is not set
# CONFIG_CGROUP_FREEZER is not set
# CONFIG_CGROUP_DEVICE is not set
# CONFIG_CGROUP_CPUACCT is not set
# CONFIG_CGROUP_PERF is not set
CONFIG_CGROUP_SCHED=y
# CONFIG_BLK_CGROUP is not set
# CONFIG_NET_CLS_CGROUP is not set
tux@slitaz:~$

2013-11-26

Slitaz -- alsamixer



alsamixer - amixer

[UPDATE 20131225 ]

Unmuting the channels
The current version of ALSA installs with all channels muted by default. You will need to unmute the channels manually.

It is easiest to use alsamixer ncurses UI to accomplish this:

$ alsamixer

Alternatively, use amixer from the command-line:

$ amixer sset Master unmute

In alsamixer, the MM label below a channel indicates that the channel is muted, and 00 indicates that it is open.

Scroll to the Master and PCM channels with the ← and → keys and unmute them by pressing the m key. Use the ↑ key to increase the volume and obtain a value of 0 dB gain. The gain can be found in the upper left next to the Item: field. Higher values of gain will produce distorted sound.


$ amixer sset 'Speaker' unmute
$ amixer sset 'Headphone' unmute

1.
tux@slitaz:~$ amixer
Simple mixer control 'Master',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum
Playback channels: Mono
Limits: Playback 0 - 64
Mono: Playback 59 [92%] [-3.75dB] [on]
Simple mixer control 'Headphone',0
Capabilities: pvolume pswitch penum
Playback channels: Front Left - Front Right
Limits: Playback 0 - 64
Mono:
Front Left: Playback 62 [97%] [-1.50dB] [off]
Front Right: Playback 62 [97%] [-1.50dB] [off]
Simple mixer control 'Speaker',0
Capabilities: pvolume pswitch penum
Playback channels: Front Left - Front Right
Limits: Playback 0 - 64
Mono:
Front Left: Playback 61 [95%] [-2.25dB] [off]
Front Right: Playback 61 [95%] [-2.25dB] [off]
[..]


2.
tux@slitaz:~$ amixer sset 'Speaker' unmute
Simple mixer control 'Speaker',0
Capabilities: pvolume pswitch penum
Playback channels: Front Left - Front Right
Limits: Playback 0 - 64
Mono:
Front Left: Playback 62 [97%] [-1.50dB] [on]
Front Right: Playback 62 [97%] [-1.50dB] [on]

3.
tux@slitaz:~$ amixer sset 'Headphone' unmute
Simple mixer control 'Headphone',0
Capabilities: pvolume pswitch penum
Playback channels: Front Left - Front Right
Limits: Playback 0 - 64
Mono:
Front Left: Playback 62 [97%] [-1.50dB] [on]
Front Right: Playback 62 [97%] [-1.50dB] [on]
tux@slitaz:~$

4.
tux@slitaz:~$ amixer scontents
Simple mixer control 'Master',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum
Playback channels: Mono
Limits: Playback 0 - 64
Mono: Playback 49 [77%] [-11.25dB] [on]
Simple mixer control 'Headphone',0
Capabilities: pvolume pswitch penum
Playback channels: Front Left - Front Right
Limits: Playback 0 - 64
Mono:
Front Left: Playback 52 [81%] [-9.00dB] [on]
Front Right: Playback 52 [81%] [-9.00dB] [on]
Simple mixer control 'Speaker',0
Capabilities: pvolume pswitch penum
Playback channels: Front Left - Front Right
Limits: Playback 0 - 64
Mono:
Front Left: Playback 61 [95%] [-2.25dB] [on]
Front Right: Playback 61 [95%] [-2.25dB] [on]
Simple mixer control 'PCM',0
Capabilities: pvolume penum
Playback channels: Front Left - Front Right
Limits: Playback 0 - 255
Mono:
Front Left: Playback 243 [95%] [-2.40dB]
Front Right: Playback 243 [95%] [-2.40dB]
Simple mixer control 'Front Mic',0
Capabilities: cvolume penum
Capture channels: Front Left - Front Right
Limits: Capture 0 - 3
Front Left: Capture 0 [0%] [0.00dB]
Front Right: Capture 0 [0%] [0.00dB]
Simple mixer control 'Front Mic Jack Mode',0
Capabilities: enum
Items: 'Mic In' 'Line In'
Item0: 'Mic In'
Simple mixer control 'Line',0
Capabilities: cvolume penum
Capture channels: Front Left - Front Right
Limits: Capture 0 - 3
Front Left: Capture 0 [0%] [0.00dB]
Front Right: Capture 0 [0%] [0.00dB]
Simple mixer control 'IEC958',0
Capabilities: pswitch pswitch-joined penum
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'IEC958 Default PCM',0
Capabilities: pswitch pswitch-joined penum
Playback channels: Mono
Mono: Playback [on]
Simple mixer control 'IEC958 Playback Source',0
Capabilities: enum
Items: 'Digital Playback' 'Off'
Item0: 'Digital Playback'
Simple mixer control 'IEC958 Playback Source',1
Capabilities: enum
Items: 'Digital Playback' 'Off'
Item0: 'Digital Playback'
Simple mixer control 'Aux',0
Capabilities: cvolume penum
Capture channels: Front Left - Front Right
Limits: Capture 0 - 3
Front Left: Capture 0 [0%] [0.00dB]
Front Right: Capture 0 [0%] [0.00dB]
Simple mixer control 'Capture',0
Capabilities: cvolume cswitch penum
Capture channels: Front Left - Front Right
Limits: Capture 0 - 15
Front Left: Capture 0 [0%] [0.00dB] [off]
Front Right: Capture 0 [0%] [0.00dB] [off]
Simple mixer control 'Capture',1
Capabilities: cvolume cswitch penum
Capture channels: Front Left - Front Right
Limits: Capture 0 - 15
Front Left: Capture 0 [0%] [0.00dB] [off]
Front Right: Capture 0 [0%] [0.00dB] [off]
Simple mixer control 'Input Source',0
Capabilities: cenum
Items: 'Front Mic' 'Rear Mic' 'Line' 'Aux'
Item0: 'Front Mic'
Simple mixer control 'Input Source',1
Capabilities: cenum
Items: 'Front Mic' 'Rear Mic' 'Line' 'Aux'
Item0: 'Front Mic'
Simple mixer control 'Rear Mic',0
Capabilities: cvolume penum
Capture channels: Front Left - Front Right
Limits: Capture 0 - 3
Front Left: Capture 0 [0%] [0.00dB]
Front Right: Capture 0 [0%] [0.00dB]
Simple mixer control 'Rear Mic Jack Mode',0
Capabilities: enum
Items: 'Mic In' 'Line In'
Item0: 'Mic In'
tux@slitaz:~$

2013-11-14

Slitaz -- lsof

lsof (list open files)

How to find what program or service is listening on ports

1.
root@slitaz:/home/tux# lsof -Pnl +M -i4
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
dropbear 1406 0 3u IPv4 4317 0t0 TCP *:22 (LISTEN)
Xorg 1433 0 3u IPv4 4504 0t0 TCP *:6000 (LISTEN)
firefox 1539 1000 45u IPv4 32787 0t0 TCP 192.168.1.30:58613->173.194.72.189:443 (ESTABLISHED)

-P no port names
-l list UID numbers
-n no host names
-i select IPv[46] files
+|-M portMap registration (-)

2.
root@slitaz:/home/tux# netstat -nltp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN 1433/Xorg
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1406/dropbear
root@slitaz:/home/tux#

Slitaz -- speedtest-cli

speedtest-cli

Command line interface for testing internet bandwidth using speedtest.net

1.
root@slitaz:/home/tux# date
Fri Nov 15 09:41:17 CST 2013

2.
root@slitaz:/home/tux# wget --no-check-certificate  https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py 
--2013-11-15 09:39:51--  https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py
Resolving raw.github.com (raw.github.com)... 103.245.222.133
Connecting to raw.github.com (raw.github.com)|103.245.222.133|:443... connected.
WARNING: cannot verify raw.github.com's certificate, issued by `/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance CA-3':
  Unable to locally verify the issuer's authority.
HTTP request sent, awaiting response... 200 OK
Length: 16485 (16K) [text/plain]
Saving to: `speedtest_cli.py'

100%[======================================>] 16,485      --.-K/s   in 0.07s  

2013-11-15 09:39:52 (226 KB/s) - `speedtest_cli.py' saved [16485/16485]

3.
root@slitaz:/home/tux# chmod 755 speedtest_cli.py

4.
root@slitaz:/home/tux# ./speedtest_cli.py
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from CHTD, Chunghwa Telecom Co., Ltd. (1.165.xx.xx)...
Selecting best server based on ping...
Hosted by Far EasTone Telecommunications Co., Ltd (Taoyuan) [30.61 km]: 12.398 ms
Testing download speed........................................
Download: 29.64 Mbit/s
Testing upload speed..................................................
Upload: 2.98 Mbit/s
root@slitaz:/home/tux#

root@slitaz:/home/tux# ./speedtest_cli.py
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from CHTD, Chunghwa Telecom Co., Ltd. (61.224.xx.xx)...
Selecting best server based on ping...
Hosted by Taiwan Fixed Network (Taichung) [1.67 km]: 14.067 ms
Testing download speed........................................
Download: 39.70 Mbit/s
Testing upload speed..................................................
Upload: 2.90 Mbit/s
root@slitaz:/home/tux#

2013-11-06

Slitaz -- JDK


get-java6-jdk

HTTP request sent, awaiting response... 404 Not Found

Processing post install commands.../usr/bin/tazpkg: cd: line 32: can't cd to /usr/lib/firefox*/plugins


1.
http://cook.slitaz.org/cooker.cgi?download=get-java6-jdk-1.0.tazpkg

root@slitaz:/tmp# get-java6-jdk
--2013-11-06 22:52:56--  http://raphaello.univ-fcomte.fr/ftp/java/Jdk/jdk-6u13-linux-i586.bin
Resolving raphaello.univ-fcomte.fr (raphaello.univ-fcomte.fr)... 194.57.88.125
Connecting to raphaello.univ-fcomte.fr (raphaello.univ-fcomte.fr)|194.57.88.125|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2013-11-06 22:52:58 ERROR 404: Not Found.


2.
# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F" http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-i586.bin

root@slitaz:/tmp# get-java6-jdk
--2013-11-06 23:06:23--  http://download.oracle.com/otn-pub/java/jdk/6u45-b06//jdk-6u45-linux-i586.bin
Resolving download.oracle.com (download.oracle.com)... 210.61.248.41, 210.61.248.24
Connecting to download.oracle.com (download.oracle.com)|210.61.248.41|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-i586.bin [following]
--2013-11-06 23:06:23--  https://edelivery.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-i586.bin
Resolving edelivery.oracle.com (edelivery.oracle.com)... 23.77.22.140
Connecting to edelivery.oracle.com (edelivery.oracle.com)|23.77.22.140|:443... connected.
WARNING: cannot verify edelivery.oracle.com's certificate, issued by `/C=US/O=GeoTrust, Inc./CN=GeoTrust SSL CA':
  Unable to locally verify the issuer's authority.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-i586.bin?AuthParam=1383750200_4cb609f881784567d740e7ca5667fe0c [following]
--2013-11-06 23:06:24--  http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-i586.bin?AuthParam=1383750200_4cb609f881784567d740e7ca5667fe0c
Connecting to download.oracle.com (download.oracle.com)|210.61.248.41|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 71799552 (68M) [application/octet-stream]
Saving to: `jdk-6u45-linux-i586.bin'

     0K .......... .......... .......... .......... ..........  0%  265K 4m24s
    50K .......... .......... .......... .......... ..........  0%  296K 4m10s
   100K .......... .......... .......... .......... ..........  0%  794K 3m16s
   150K .......... .......... .......... .......... ..........  0%  638K 2m54s
[..]
 70050K .......... .......... .......... .......... .......... 99% 5.49M 0s
 70100K .......... ......                                     100% 10.9M=16s

2013-11-06 23:06:41 (4.39 MB/s) - `jdk-6u45-linux-i586.bin' saved [71799552/71799552]

Unpacking...
Checksumming...
Extracting...
UnZipSFX 5.50 of 17 February 2002, by Info-ZIP (Zip-Bugs@lists.wku.edu).
   creating: jdk1.6.0_45/
[..]
Creating jdk1.6.0_45/jre/lib/javaws.jar
Creating jdk1.6.0_45/jre/lib/deploy.jar

Done.

Packing : java6-jdk-1.6.0_45
================================================================================
Creating the list of files...                                        [ OK ]
Creating md5sum of files...                                          [ OK ]
Compressing the fs...                                                [ OK ]
Updating receipt sizes...                                            [ OK ]
Creating full cpio archive...                                        [ OK ]
Restoring original package tree...                                   [ OK ]
================================================================================
Package java6-jdk-1.6.0_45 compressed successfully.
Size : 64.1M    java6-jdk-1.6.0_45.tazpkg


Installation of : java6-jdk
================================================================================
Copying java6-jdk...                                                 [ OK ]
Extracting java6-jdk...                                              [ OK ]
Extracting the pseudo fs... (lzma)                                   [ OK ]
Installing java6-jdk...                                              [ OK ]
Removing all tmp files...                                            [ OK ]
Processing post install commands.../usr/bin/tazpkg: cd: line 32: can't cd to /usr/lib/firefox*/plugins
                                                                     [ OK ]
================================================================================
java6-jdk (1.6.0_45) is installed.


3.
root@slitaz:/tmp# ls -l /usr/lib/mozilla/plugins/
total 0
lrwxrwxrwx    1 root     root            34 Nov  7 00:24 libflashplayer.so -> /usr/share/flash/libflashplayer.so
lrwxrwxrwx    1 root     root            50 Nov  6 23:44 libnpjp2.so -> /usr/lib/java/jdk1.6.0_45/jre/lib/i386/libnpjp2.so


4.
root@slitaz:/tmp# java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) Server VM (build 20.45-b01, mixed mode)

root@slitaz:/tmp# javac -version
javac 1.6.0_45

root@slitaz:/tmp# javap -help | head -1
Usage: javap <options> <classes>...

root@slitaz:/tmp# javadoc -help | head -2
usage: javadoc [options] [packagenames] [sourcefiles] [@files]
-overview <file>          Read overview documentation from HTML file



5.
root@slitaz:/tmp# diff /usr/bin/get-java6-jdk-1.0 /usr/bin/get-java6-jdk
--- /usr/bin/get-java6-jdk-1.0
+++ /usr/bin/get-java6-jdk
@@ -6,9 +6,9 @@
 # Author : K�vin DA SILVA <dasilvakevin@hotmail.fr>

 PACKAGE="java6-jdk"
-VERSION="1.6.0_13"
-URL="http://raphaello.univ-fcomte.fr/ftp/java/Jdk"
-TARBALL="jdk-6u13-linux-i586.bin"
+VERSION="1.6.0_45"
+URL="http://download.oracle.com/otn-pub/java/jdk/6u45-b06"
+TARBALL="jdk-6u45-linux-i586.bin"
 TEMP_DIR="/tmp/$PACKAGE.$$"
 ROOT="$1"

@@ -38,7 +38,7 @@
 cd $TEMP_DIR

 # Download the file
-test -f $TARBALL || wget $URL/$TARBALL
+test -f $TARBALL || wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F" $URL/$TARBALL
 if [ ! -f $TARBALL ]; then
     cd $CUR_DIR
     rm -rf $TMP_DIR
@@ -80,8 +80,8 @@
 post_install()
 {
     echo -n "Processing post install commands..."
-    cd /usr/lib/firefox*/plugins
-    ln -s /usr/lib/java/jdk\$VERSION/jre/plugin/i386/ns7/libjavaplugin_oji.so
+    [ -d /usr/lib/mozilla/plugins ] || mkdir -p /usr/lib/mozilla/plugins
+    ln -s /usr/lib/java/jdk\$VERSION/jre/lib/i386/libnpjp2.so /usr/lib/mozilla/plugins

     #lien mit dans red5 /usr/bin/javajdk
     cd /usr/bin
@@ -94,8 +94,11 @@

 post_remove()
 {
-    rm -f /usr/lib/firefox*/plugins/libjavaplugin_oji.so
+    rm -f /usr/lib/mozilla/plugins/libnpjp2.so
     rm -f /usr/bin/java
+    rm -f /usr/bin/javac
+    rm -f /usr/bin/javadoc
+    rm -f /usr/bin/javap
 }
 EOT


6.
Package: get-java6-jdk
http://cook.slitaz.org/cooker.cgi?pkg=get-java6-jdk

receipt home files download
Cook summary

Summary for: get-java6-jdk 1.0
================================================================================
Produced    : 4.0K
Packed      : 32.0K
Compressed  : 4.0K
Files       : 1
Cook time   : 1s
Cook date   : 2013-09-22 13:54
Host arch   : i486
================================================================================

Slitaz -- JRE

get-java6-jre
Could not download jre.bin. Exiting.

# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jre-6u45-linux-i586.bin"

JDK 6u45
http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-i586.bin
JRE 6u45
http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jre-6u45-linux-i586.bin

JDK 7u25
    http://download.oracle.com/otn-pub/java/jdk/7u25-b15/jdk-7u25-linux-i586.tar.gz
JRE 7u25
    http://download.oracle.com/otn-pub/java/jdk/7u25-b15/jre-7u25-linux-i586.tar.gz
JDK 7u45
    http://download.oracle.com/otn-pub/java/jdk/7u45-b18/jdk-7u45-linux-i586.tar.gz


1.
# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jre-6u45-linux-i586.bin"

# curl -L -O -k -H "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-i586.bin"

root@slitaz:/home/tux# curl -L -O -k -H "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-i586.bin"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0   286    0     0    347      0 --:--:-- --:--:-- --:--:--   347
100 68.4M  100 68.4M    0     0  3715k      0  0:00:18  0:00:18 --:--:-- 3167k
root@slitaz:/home/tux#

 -H, --header LINE   Custom header to pass to server (H)
 -k, --insecure      Allow connections to SSL sites without certs (H)
 -L, --location      Follow redirects (H)
 -o, --output FILE   Write output to <file> instead of stdout
 -O, --remote-name   Write output to a file named as the remote file
     --remote-name-all Use the remote file name for all URLs


2.
root@slitaz:/home/tux# java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) Server VM (build 20.45-b01, mixed mode)


3.
http://mirror.slitaz.org/packages/cooking/get-java6-jre-1.1.0.tazpkg

root@slitaz:/home/tux# diff /usr/bin/get-java6-jre-1.1.0 /usr/bin/get-java6-jre
--- /usr/bin/get-java6-jre-1.1.0
+++ /usr/bin/get-java6-jre
@@ -6,15 +6,15 @@
 # Author : Eric Joseph-Alexandre <erjo@slitaz.org>

 PACKAGE="java6-jre"
-WEB_SITE="http://www.java.com/"
+WEB_SITE="http://download.oracle.com/otn-pub/java/jdk/"
 SHORT_DESC="SUN Java Runtime."
 DEPENDS="xorg-libXtst"
 TARBALL="jre.bin"
 TEMP_DIR="/tmp/$PACKAGE.$$"
 ROOT="$1"

-URL="$(wget -O - ${WEB_SITE}en/download/manual_v6.jsp | \
-       sed '/self-extracting/!d;s/.*href="\([^"]*\).*/\1/;q')"
+# URL="$(wget -O - ${WEB_SITE}en/download/manual_v6.jsp | \
+#       sed '/self-extracting/!d;s/.*href="\([^"]*\).*/\1/;q')"

 # Check if we are root starting anything
 if test $(id -u) != 0 ; then
@@ -36,8 +36,12 @@
 test -d $TEMP_DIR || mkdir $TEMP_DIR
 cd $TEMP_DIR

+# FIXME. http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jre-6u45-linux-i586.bin
+URL="$(wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F" -O $TARBALL ${WEB_SITE}6u45-b06/jre-6u45-linux-i586.bin)"
+
 # Download the file
-test -f $TARBALL || wget $URL -O $TARBALL
+# test -f $TARBALL || wget $URL -O $TARBALL
+test -f $TARBALL || $URL
 if [ ! -f $TARBALL ]; then
     cd $CUR_DIR
     rm -rf $TEMP_DIR
root@slitaz:/home/tux#


4.
wok - Searching for 'java'
http://hg.slitaz.org/wok/log?rev=java

age     author     description
2 days ago     Dominique Corbex     get-LibreOffice: mv java from DEPS to SUGGESTED
8 weeks ago     Pascal Bellard     Add some licenses
8 weeks ago     Pascal Bellard     get-*: add license
2 months ago     Pascal Bellard     Add some GPL2 licenses
3 months ago     Pascal Bellard     *vnc*: add LICENSE
3 months ago     Eric Joseph-Alexandre     Add: tightvnc-java
10 months ago     Pascal Bellard     Update get-java6-jre (again)
10 months ago     Pascal Bellard     Update get-java6-jre (thanks ernia)
17 months ago     Richard Dunbar     get-java6-jre: fix generic with tar
17 months ago     Richard Dunbar     get-java6-jre: update tarball


Ref:
http://www.oracle.com/technetwork/java/javase/terms/license/index.html
http://stackoverflow.com/questions/10268583/how-to-automate-download-and-instalation-of-java-jdk-on-linux

2013-11-05

Debian HCL




Debian HCL (Hardware Compatibility List) Web system

Debian GNU/Linux device driver check page

Boot your machine with a GNU/Linux OS (such as Debian, Knoppix, Redhat, and so on), run 'lspci -n' and paste the output into the box below, then press 'Check' button.

Notice:
  • This database uses the PCI map of Debian kernel 3.2.0-4-amd64 .
  • The result does NOT guarantee your hardware works perfectly.
  • This database only verifies the PCI devices at this time. X drivers, ISA, USB, IEEE1394 or any other devices are out of the focus. 

2013-11-01

Slitaz -- lxc / templates

lxc-busybox
....
install_busybox()

1.
root@slitaz:/home/tux# ls /usr/lib/lxc/templates
lxc-busybox   lxc-fedora    lxc-lucid     lxc-natty
lxc-debian    lxc-lenny     lxc-maverick  lxc-sshd


2.
root@slitaz:/home/tux# ls /var/lib/lxc/slitaz-lxc/rootfs
bin      etc      lib      mnt      root     selinux  usr
dev      home     lib64    proc     sbin     tmp      var

    rootfs=$1
    name=$2
    res=0
    tree="\
$rootfs/selinux \
$rootfs/dev \
$rootfs/home \
$rootfs/root \
$rootfs/etc \
$rootfs/etc/init.d \
$rootfs/bin \
$rootfs/sbin \
$rootfs/proc \
$rootfs/mnt \
$rootfs/tmp \
$rootfs/var/log \
$rootfs/usr/share/udhcpc \
$rootfs/dev/pts \
$rootfs/dev/shm \
$rootfs/lib \
$rootfs/usr/lib \
$rootfs/lib64 \
$rootfs/usr/lib64"

    mkdir -p $tree || return 1
    chmod 755 $tree || return 1


3.
root@slitaz:/home/tux# ls -l /var/lib/lxc/slitaz-lxc/rootfs/dev
total 8
crw-rw-rw-    1 root     root        5,   1 Nov  1 12:47 console
crw-rw-rw-    1 root     root        1,   3 Nov  1 12:47 null
lrwxrwxrwx    1 root     root            13 Nov  1 13:12 ptmx -> /dev/pts/ptmx
drwxr-xr-x    2 root     root          4096 Nov  1 12:47 pts
brw-------    1 root     root        1,   0 Nov  1 12:47 ram0
drwxr-xr-x    2 root     root          4096 Nov  1 12:47 shm
crw-rw-rw-    1 root     root        5,   0 Nov  1 12:47 tty
crw-rw-rw-    1 root     root        4,   0 Nov  1 12:47 tty0
crw-r--r--    1 root     root        4,   0 Nov  1 12:47 tty1
crw-r--r--    1 root     root        4,   0 Nov  1 12:47 tty5

    # minimal devices needed for busybox
    mknod tty c 5 0       || res=1
    mknod console c 5 1   || res=1
    chmod 666 tty console || res=1
    mknod tty0 c 4 0      || res=1
    mknod tty1 c 4 0      || res=1
    mknod tty5 c 4 0      || res=1
    chmod 666 tty0        || res=1
    mknod ram0 b 1 0      || res=1
    chmod 600 ram0        || res=1
    mknod null c 1 3      || res=1
    chmod 666 null        || res=1


4.
root@slitaz:/home/tux# cat /var/lib/lxc/slitaz-lxc/rootfs/etc/passwd
root:x:0:0:root:/root:/bin/sh

    # root user defined
    cat <<EOF >> $rootfs/etc/passwd
root:x:0:0:root:/root:/bin/sh
EOF


5.
root@slitaz:/home/tux# cat /var/lib/lxc/slitaz-lxc/rootfs/etc/group
root:x:0:root

    cat <<EOF >> $rootfs/etc/group
root:x:0:root
EOF


6.
root@slitaz:/home/tux# cat /var/lib/lxc/slitaz-lxc/rootfs/etc/init.d/rcS
#!/bin/sh
/bin/syslogd
/bin/mount -a
/bin/udhcpc

    cat <<EOF >> $rootfs/etc/init.d/rcS
#!/bin/sh
/bin/syslogd
/bin/mount -a
/bin/udhcpc
EOF


7.
root@slitaz:/home/tux# cat /var/lib/lxc/slitaz-lxc/rootfs/etc/fstab
proc  /proc      proc    defaults     0      0
shm   /dev/shm   tmpfs   defaults     0      0

    # mount points
    cat <<EOF >> $rootfs/etc/fstab
proc  /proc      proc    defaults     0      0
shm   /dev/shm   tmpfs   defaults     0      0
EOF


8.
root@slitaz:/home/tux# cat /var/lib/lxc/slitaz-lxc/rootfs/etc/inittab
::sysinit:/etc/init.d/rcS
tty1::respawn:/bin/getty -L tty1 115200 vt100
console::askfirst:/bin/sh

    cat <<EOF >> $rootfs/etc/inittab
::sysinit:/etc/init.d/rcS
tty1::respawn:/bin/getty -L tty1 115200 vt100
console::askfirst:/bin/sh
EOF


9.
root@slitaz:/home/tux# cat /var/lib/lxc/slitaz-lxc/rootfs/usr/share/udhcpc/default.script
#!/bin/sh

case "$1" in
    deconfig)
        ip addr flush dev $interface
                ;;

    renew|bound)

                # flush all the routes
        if [ -n "$router" ]; then
                        ip route del default 2> /dev/null
        fi

                # check broadcast
                if [ -n "$broadcast" ]; then
                        broadcast="broadcast $broadcast"
                fi

                # add a new ip address
        ip addr add $ip/$mask $broadcast dev $interface

        if [ -n "$router" ]; then
                        ip route add default via $router dev $interface
                fi

        [ -n "$domain" ] && echo search $domain > /etc/resolv.conf
        for i in $dns ; do
            echo nameserver $i >> /etc/resolv.conf
        done
        ;;
esac
exit 0

----

    cat <<EOF >> $rootfs/usr/share/udhcpc/default.script
#!/bin/sh

case "\$1" in
    deconfig)
        ip addr flush dev \$interface
                ;;

    renew|bound)

                # flush all the routes
        if [ -n "\$router" ]; then
                        ip route del default 2> /dev/null
        fi

                # check broadcast
                if [ -n "\$broadcast" ]; then
                        broadcast="broadcast \$broadcast"
                fi

                # add a new ip address
        ip addr add \$ip/\$mask \$broadcast dev \$interface

        if [ -n "\$router" ]; then
                        ip route add default via \$router dev \$interface
                fi

        [ -n "\$domain" ] && echo search \$domain > /etc/resolv.conf
        for i in \$dns ; do
            echo nameserver \$i >> /etc/resolv.conf
        done
        ;;
esac
exit 0
EOF


Slitaz -- lxc / HOST

HOST :

1.
root@slitaz:/home/tux# mount | grep cgroup
cgroup on /sys/fs/cgroup type cgroup (rw,relatime,blkio,net_cls,freezer,devices,memory,cpuacct,cpu,ns,cpuset)


2.
root@slitaz:/home/tux# lxc-info -n slitaz-lxc
'slitaz-lxc' is RUNNING


3.
root@slitaz:/home/tux# ps ax | tail -9
 1624 pts/3    S+     0:00 lxc-start -n slitaz-lxc
 1625 ?        Ss     0:00 init     
 1628 ?        Ss     0:00 /bin/syslogd
 1630 pts/4    Ss+    0:00 /bin/getty -L tty1 115200 vt100
 1631 pts/5    Ss+    0:00 /bin/sh
 1632 pts/1    S      0:00 sudo -s
 1633 pts/1    S      0:00 /bin/sh
 1662 pts/1    R+     0:00 ps ax
 1663 pts/1    S+     0:00 tail -9

root@slitaz:/home/tux# lxc-ps -n slitaz-lxc
CONTAINER    PID TTY          TIME CMD
            1632 pts/1    00:00:00 sudo
            1633 pts/1    00:00:00 sh
            1667 pts/1    00:00:00 lxc-ps
            1668 pts/1    00:00:00 ps


4.
root@slitaz:/home/tux# ls /sys/fs/cgroup
blkio.io_merged                  cpuset.memory_spread_slab
blkio.io_queued                  cpuset.mems
blkio.io_service_bytes           cpuset.sched_load_balance
blkio.io_serviced                cpuset.sched_relax_domain_level
blkio.io_service_time            cpu.shares
blkio.io_wait_time               devices.allow
blkio.reset_stats                devices.deny
blkio.sectors                    devices.list
blkio.time                       memory.failcnt
blkio.weight                     memory.force_empty
blkio.weight_device              memory.limit_in_bytes
cgroup.clone_children            memory.max_usage_in_bytes
cgroup.event_control             memory.memsw.failcnt
cgroup.procs                     memory.memsw.limit_in_bytes
cpuacct.stat                     memory.memsw.max_usage_in_bytes
cpuacct.usage                    memory.memsw.usage_in_bytes
cpuacct.usage_percpu             memory.move_charge_at_immigrate
cpu.rt_period_us                 memory.oom_control
cpu.rt_runtime_us                memory.soft_limit_in_bytes
cpuset.cpu_exclusive             memory.stat
cpuset.cpus                      memory.swappiness
cpuset.mem_exclusive             memory.usage_in_bytes
cpuset.mem_hardwall              memory.use_hierarchy
cpuset.memory_migrate            net_cls.classid
cpuset.memory_pressure           notify_on_release
cpuset.memory_pressure_enabled   release_agent
cpuset.memory_spread_page        tasks


5.
root@slitaz:/home/tux# cat /sys/fs/cgroup/memory.stat
cache 1361383424
rss 484990976
mapped_file 41578496
pgpgin 18986980
pgpgout 18536205
swap 0
inactive_anon 54640640
active_anon 485179392
inactive_file 937705472
active_file 368799744
unevictable 0
hierarchical_memory_limit 9223372036854775807
hierarchical_memsw_limit 9223372036854775807
total_cache 1361383424
total_rss 484990976
total_mapped_file 41578496
total_pgpgin 18986980
total_pgpgout 18536205
total_swap 0
total_inactive_anon 54640640
total_active_anon 485179392
total_inactive_file 937705472
total_active_file 368799744
total_unevictable 0
root@slitaz:/home/tux#

Slitaz -- lxc / rm

rm: unrecognized option '--preserve-root'

Fix: coreutils-operations dont remove cp/rm in post_install, we need them to install


1.
root@slitaz:/home/tux# lxc-create -n slitaz-lxc -t busybox
rm: unrecognized option '--preserve-root'   

Command line: rm -rf --preserve-root /var/lib/lxc/slitaz-lxc

BusyBox v1.18.4 (2012-03-14 03:32:25 CET) multi-call binary.

Usage: rm [-irf] FILE...

Remove (unlink) FILEs

Options:
    -i    Always prompt before removing
    -f    Never prompt
    -R,-r    Recurse


2.
root@slitaz:/home/tux# ls -l /bin/rm /usr/bin/rm
lrwxrwxrwx    1 root     root            12 Nov  1 23:37 /bin/rm -> /bin/busybox
-rwxr-xr-x    1 root     root         55487 Nov  1 11:08 /usr/bin/rm


3.
root@slitaz:/home/tux# which rm
/usr/bin/rm


4.
root@slitaz:/home/tux# echo $PATH
/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/sbin:/usr/local/bin


5.
root@slitaz:/home/tux# rm --version
rm (GNU coreutils) 8.12
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Paul Rubin, David MacKenzie, Richard M. Stallman,
and Jim Meyering.


6.
root@slitaz:/home/tux# rm --help | grep root
      --no-preserve-root  do not treat `/' specially
      --preserve-root   do not remove `/' (default)


7.
Receipt for: coreutils-operations
http://cook.slitaz.org/cooker.cgi?receipt=coreutils-operations

# SliTaz package receipt.

PACKAGE="coreutils-operations"
VERSION="8.12"
CATEGORY="system-tools"
SHORT_DESC="GNU utilities that perform basic operations."
MAINTAINER="rcx@zoominternet.net"
LICENSE="GPL3"
WEB_SITE="http://www.gnu.org/software/coreutils/"
WANTED="coreutils"

DEPENDS="glibc-base acl"

# Rules to gen a SliTaz package suitable for Tazpkg.
#
# This is a special package for installed system or developer. We only take
# a few things, as Busybox provides all the basic utilities, but not for compiling.
# But DO NOT erase a Busybox applet, remove it before with pre_install rules.
#
genpkg_rules()
{
    mkdir -p $fs/bin
    #cp -a $install/usr/bin/cp $fs/bin
    cp -a $install/usr/bin/dd $fs/bin
    cp -a $install/usr/bin/mv $fs/bin
    cp -a $install/usr/bin/ln $fs/bin
    #cp -a $install/usr/bin/rm $fs/bin

    mkdir -p $fs/usr/bin
    cp -a $install/usr/bin/install $fs/usr/bin
    cp -a $install/usr/bin/shred $fs/usr/bin
}

# Pre and post install commands for Tazpkg.
# We must remove all Busybox symlink before installing.
#
pre_install()
{
    local root
    root=$1
    echo "Processing pre-install commands..."
    echo -n "Removing all Busybox replaced utils... "
    rm -f $root/bin/dd $root/bin/mv $root/bin/ln
    rm -f $root/usr/bin/install $root/usr/bin/shred
    # Dont remove cp/rm or the installation will fail because tazpkg use
    # cp and rm during the process.
    #
    #rm -f $root/bin/cp $root/bin/rm
    status
}

post_remove()
{
    # use busybox ln applet directly since /bin/ln
    # in this package is remove already
    /bin/busybox ln -s /bin/busybox $1/bin/cp
    /bin/busybox ln -s /bin/busybox $1/bin/dd
    /bin/busybox ln -s /bin/busybox $1/bin/mv
    /bin/busybox ln -s /bin/busybox $1/bin/ln
    /bin/busybox ln -s /bin/busybox $1/bin/rm
    /bin/busybox ln -s /bin/busybox $1/usr/bin/install
    /bin/busybox ln -s /bin/busybox $1/usr/bin/shred
}


8.
Fix: coreutils-operations dont remove cp/rm in post_install, we need them to install
http://hg.slitaz.org/wok/raw-rev/59b766d69633

# HG changeset patchs
# User Christophe Lincoln <pankso@slitaz.org>
# Date 1253559865 -7200
# Node ID 59b766d69633316bc1a1b70fe1d8e2a30c43d279
# Parent  6ef3727f527d032a1515dd96bece7bea625c3b8a
Fix: coreutils-operations dont remove cp/rm in post_install, we need them to install

diff -r 6ef3727f527d -r 59b766d69633 coreutils-operations/receipt
--- a/coreutils-operations/receipt    Mon Sep 21 13:37:43 2009 +0200
+++ b/coreutils-operations/receipt    Mon Sep 21 21:04:25 2009 +0200
@@ -18,10 +18,10 @@
 genpkg_rules()
 {
     mkdir -p $fs/bin
-    cp -a $_pkg/usr/bin/cp $fs/bin
+    #cp -a $_pkg/usr/bin/cp $fs/bin
     cp -a $_pkg/usr/bin/dd $fs/bin
     cp -a $_pkg/usr/bin/mv $fs/bin
-    cp -a $_pkg/usr/bin/rm $fs/bin
+    #cp -a $_pkg/usr/bin/rm $fs/bin

     mkdir -p $fs/usr/bin
     cp -a $_pkg/usr/bin/install $fs/usr/bin
@@ -37,8 +37,12 @@
     root=$1
     echo "Processing pre-install commands..."
     echo -n "Removing all Busybox replaced utils... "
-    rm -f $root/bin/cp $root/bin/dd $root/bin/mv $root/bin/rm
+    rm -f $root/bin/dd $root/bin/mv
     rm -f $root/usr/bin/install $root/usr/bin/shred
+    # Dont remove cp/rm or the installation will fail because tazpkg use
+    # cp and rm during the process.
+    #
+    #rm -f $root/bin/cp $root/bin/rm
     status
 }


Slitaz -- lxc-2

1.
root@slitaz:/home/tux# lxc-start -n slitaz-lxc

Please press Enter to activate this console.


2.
root@slitaz-lxc:/# echo 'nameserver 168.95.1.1' > /etc/resolv.conf

root@slitaz-lxc:/# ping -c4 www.yahoo.com
ping -c4 www.yahoo.com
PING www.yahoo.com (203.84.197.9): 56 data bytes
64 bytes from 203.84.197.9: seq=0 ttl=55 time=21.430 ms
64 bytes from 203.84.197.9: seq=1 ttl=55 time=24.953 ms
64 bytes from 203.84.197.9: seq=2 ttl=55 time=22.802 ms
64 bytes from 203.84.197.9: seq=3 ttl=55 time=21.091 ms

--- www.yahoo.com ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 21.091/22.569/24.953 ms


3.
root@slitaz-lxc:/# ls -R /etc
ls -R /etc
/etc:
fstab        init.d       passwd       shadow
group        inittab      resolv.conf

/etc/init.d:
rcS


4.
root@slitaz-lxc:/# cat /etc/inittab
cat /etc/inittab
::sysinit:/etc/init.d/rcS
tty1::respawn:/bin/getty -L tty1 115200 vt100
console::askfirst:/bin/sh


5.
root@slitaz-lxc:/# cat /etc/init.d/rcS
cat /etc/init.d/rcS
#!/bin/sh
/bin/syslogd
/bin/mount -a
#/bin/udhcpc


6.
root@slitaz-lxc:/# mount
mount
rootfs on / type rootfs (rw)
/dev/root on / type ext2 (rw,relatime,barrier=1,data=ordered)
/dev/root on /lib type ext2 (ro,relatime,barrier=1,data=ordered)
/dev/root on /usr/lib type ext2 (ro,relatime,barrier=1,data=ordered)
devpts on /dev/console type devpts (rw,relatime,mode=600,ptmxmode=000)
devpts on /dev/tty1 type devpts (rw,relatime,mode=600,ptmxmode=000)
devpts on /dev/pts type devpts (rw,relatime,mode=600,ptmxmode=666)
devpts on /dev/pts/ptmx type devpts (rw,relatime,mode=600,ptmxmode=666)
proc on /proc type proc (rw,relatime)
shm on /dev/shm type tmpfs (rw,relatime)


7.
root@slitaz-lxc:/# ps
ps
PID   USER     TIME   COMMAND
    1 root       0:00 init
    4 root       0:00 /bin/syslogd
    6 root       0:00 /bin/getty -L tty1 115200 vt100
    7 root       0:00 /bin/sh
   13 root       0:00 ps


8.
root@slitaz-lxc:/# cat /var/log/messages
cat /var/log/messages
Nov  1 05:12:00 slitaz-lxc syslog.info syslogd started: BusyBox v1.18.4
Nov  1 05:12:00 slitaz-lxc daemon.info init: starting pid 7, tty '/dev/tty1': '/bin/getty -L tty1 115200 vt100'
Nov  1 05:12:23 slitaz-lxc daemon.info init: starting pid 8, tty '/dev/console': '/bin/sh'

Slitaz -- lxc / kernel

Kernel Setup

CONFIG_GROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
CONFIG_RT_GROUP_SCHED=y
CONFIG_CGROUP_SCHED=y
CONFIG_CGROUPS=y
CONFIG_CGROUP_NS=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CPUSETS=y
CONFIG_PROC_PID_CPUSET=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_RESOURCE_COUNTERS=y
CONFIG_CGROUP_MEM_RES_CTLR=y
CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y
CONFIG_MM_OWNER=y
CONFIG_NAMESPACES=y
CONFIG_UTS_NS=y
CONFIG_IPC_NS=y
CONFIG_USER_NS=y
CONFIG_PID_NS=y
CONFIG_NET_NS=y
CONFIG_NET_CLS_CGROUP=y
CONFIG_SECURITY_FILE_CAPABILITIES=y
CONFIG_DEVPTS_MULTIPLE_INSTANCES=y

1.
root@slitaz:/home/tux# zcat /proc/config.gz | grep CGROUP
CONFIG_CGROUPS=y
# CONFIG_CGROUP_DEBUG is not set
CONFIG_CGROUP_NS=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_MEM_RES_CTLR=y
CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y
CONFIG_CGROUP_MEM_RES_CTLR_SWAP_ENABLED=y
CONFIG_CGROUP_SCHED=y
CONFIG_BLK_CGROUP=y
# CONFIG_DEBUG_BLK_CGROUP is not set
CONFIG_NET_CLS_CGROUP=y


2.
root@slitaz:/home/tux# mount cgroup -t cgroup /sys/fs/cgroup

root@slitaz:/home/tux# mount | grep cgroup
cgroup on /sys/fs/cgroup type cgroup (rw,relatime,blkio,net_cls,freezer,devices,memory,cpuacct,cpu,ns,cpuset)


3.
root@slitaz:/home/tux# tazpkg -gi lxc

root@slitaz:/home/tux# lxc-create -n slitaz-lxc -t busybox

Warning:
-------
Usually the template option is called with a configuration
file option too, mostly to configure the network.
eg. lxc-create -n foo -f lxc.conf -t debian
The configuration file is often:

lxc.network.type=macvlan
lxc.network.link=eth0
lxc.network.flags=up

or alternatively:

lxc.network.type=veth
lxc.network.link=br0
lxc.network.flags=up

For more information look at lxc.conf (5)

At this point, I assume you know what you do.
Press <enter> to continue ...

warning : busybox is not statically linked.
warning : The template script may not correctly
warning : setup the container environment.
chroot: failed to run command `/bin/passwd': No such file or directory
No password for 'root', please change !
'busybox' template installed
'slitaz-lxc' created

root@slitaz:/home/tux# which passwd
/usr/bin/passwd


4.
root@slitaz:/home/tux# ls -l /var/lib/lxc/slitaz-lxc/rootfs
total 64
drwxr-xr-x    2 root     root         12288 Nov  1 12:47 bin
drwxr-xr-x    4 root     root          4096 Nov  1 12:47 dev
drwxr-xr-x    3 root     root          4096 Nov  1 12:47 etc
drwxr-xr-x    2 root     root          4096 Nov  1 12:47 home
drwxr-xr-x    2 root     root          4096 Nov  1 12:47 lib
drwxr-xr-x    2 root     root          4096 Nov  1 12:47 lib64
drwxr-xr-x    2 root     root          4096 Nov  1 12:47 mnt
drwxr-xr-x    2 root     root          4096 Nov  1 12:47 proc
drwxr-xr-x    2 root     root          4096 Nov  1 12:47 root
drwxr-xr-x    2 root     root          4096 Nov  1 12:47 sbin
drwxr-xr-x    2 root     root          4096 Nov  1 12:47 selinux
drwxr-xr-x    2 root     root          4096 Nov  1 12:47 tmp
drwxr-xr-x    5 root     root          4096 Nov  1 12:47 usr
drwxr-xr-x    3 root     root          4096 Nov  1 12:47 var

root@slitaz:/home/tux# du -sh /var/lib/lxc/slitaz-lxc/rootfs/
748.0K    /var/lib/lxc/slitaz-lxc/rootfs/


5.
root@slitaz:/home/tux# cat /var/lib/lxc/slitaz-lxc/config
lxc.utsname = slitaz-lxc
lxc.tty = 1
lxc.pts = 1
lxc.rootfs = /var/lib/lxc/slitaz-lxc/rootfs
lxc.mount.entry=/lib /var/lib/lxc/slitaz-lxc/rootfs/lib none ro,bind 0 0
lxc.mount.entry=/usr/lib /var/lib/lxc/slitaz-lxc/rootfs/usr/lib none ro,bind 0 0


Ref:
1. Control Groups
=================

1.1 What are cgroups ?
----------------------

Control Groups provide a mechanism for aggregating/partitioning sets of tasks, and all their future children, into hierarchical groups with specialized behaviour.


                      =============
                      CFS Scheduler
                      =============

1.  OVERVIEW

CFS stands for "Completely Fair Scheduler," and is the new "desktop" process scheduler implemented by Ingo Molnar and merged in Linux 2.6.23.  It is the replacement for the previous vanilla scheduler's SCHED_OTHER interactivity code.

Slitaz -- lxc


Linux Containers

Linux Containers (LXC) are an operating system-level virtualization method for running multiple isolated server installs (containers) on a single control host. LXC does not provide a virtual machine, but rather provides a virtual environment that has its own process and network space. It is similar to a chroot, but offers much more isolation.

1.
root@slitaz:/home/tux# lxc-checkconfig
--- Namespaces ---
Namespaces: enabled
Utsname namespace: enabled
Ipc namespace: enabled
Pid namespace: enabled
User namespace: enabled
Network namespace: enabled
Multiple /dev/pts instances: enabled

--- Control groups ---
Cgroup: enabled
Cgroup namespace: enabled
Cgroup device: enabled
Cgroup sched: enabled
Cgroup cpu account: enabled
Cgroup memory controller: enabled
Cgroup cpuset: enabled

--- Misc ---
Veth pair device: enabled
Macvlan: enabled
Vlan: enabled
File capabilities: enabled

Note : Before booting a new kernel, you can check its configuration
usage : CONFIG=/path/to/config /usr/bin/lxc-checkconfig


2.
root@slitaz:/home/tux# lxc-start -n slitaz-lxc

Please press Enter to activate this console.

3.
root@slitaz-lxc:/# ls /dev
ls /dev
console  null     pts      shm      tty0     tty5
log      ptmx     ram0     tty      tty1

4.
root@slitaz-lxc:/# nslookup cook.slitaz.org
nslookup cook.slitaz.org
Server:    168.95.1.1
Address 1: 168.95.1.1 dns.hinet.net

Name:      cook.slitaz.org
Address 1: 37.187.4.13 ks3367256.kimsufi.com
root@slitaz-lxc:/#

2013-10-18

Slitaz -- git-hg




mercurial to git converter using git-fast-import

# tazpkg -i hg-fast-export-20120921-1.tazpkg
# git-hg clone http://hg.slitaz.org/cookutils
# tazpkg -i gitk-1.8.3.tazpkg


## Usage ##
- Clone an hg repo, including ones over HTTP:
        $ git-hg clone http://some/random/hg/repo [local-git-repo-name]

- Fetch updates from the hg repo:
        $ git-hg fetch

    or optionally:
        $ git-hg pull # same as git-hg-fetch && git merge hg/branch_name

- Checkout a new branch from hg:
        $ git-hg checkout branch_name
       
- Push changes back to hg, optionally to a specific destination:
        $ git-hg push [destination]


## Structure ##
`.git/hgcheckout` - contains a bare mercurial checkout of the specified repo

`.git/hgremote` - contains a bare git repo clones from the mercurial one,
   this is added as a remote called "hg" in the base repo

2013-10-17

Slitaz -- bootguide



From BIOS to /etc/init.d/rcS

  1. Uncommon is LVM, RAID, crypto, loop or subdir mount with preinit rootfs.
  2. Versatile boot floppy - http://mirror.slitaz.org/boot/floppy-grub4dos
  3. Boot floppy set - http://mirror.slitaz.org/floppies/
  4. LAN PXE or WEB boot.
  5. gpxe.pxe.
  6. Tiny slitaz, see http://tiny.slitaz.org/
  7. Lowram CD.
  8. kexec command from the kexec-tools package.

2013-10-16

Slitaz -- firefox



firefox-17.0.8esr.tazpkg: no such file

1.
root@slitaz:/home/tux# date
Wed Oct 16 16:49:37 UTC 2013
root@slitaz:/home/tux# tazpkg recharge
Main is up to date.


2.
root@slitaz:/home/tux# tazpkg -gi firefox

Connecting to mirror.slitaz.org (91.121.171.224:80)
wget: server returned error: HTTP/1.1 404 Not Found
Connecting to mirror.slitaz.org (91.121.171.224:80)
wget: server returned error: HTTP/1.1 404 Not Found
/usr/bin/tazpkg: line 2817: can't open /var/cache/tazpkg/cooking/packages/firefox-17.0.8esr.tazpkg: no such file
/usr/bin/tazpkg: .: line 2817: can't open '/tmp/7287/receipt'

root@slitaz:/home/tux# wget http://mirror.slitaz.org/packages/cooking/firefox-17.0.9esr.tazpkg
Connecting to mirror.slitaz.org (91.121.171.224:80)
firefox-17.0.9esr.ta 100% |************************************| 15856k  0:00:00 ETA


3.
root@slitaz:/home/tux# wget http://mirror.slitaz.org/packages/cooking/ID
Connecting to mirror.slitaz.org (91.121.171.224:80)
ID                   100% |************************************|    33   0:00:00 ETA

root@slitaz:/home/tux# cat ID
0461959b270c73d599ba749c464dd5d8

root@slitaz:/home/tux# cat /var/lib/tazpkg/ID
0461959b270c73d599ba749c464dd5d8


4.
root@slitaz:/home/tux# grep firefox /var/lib/tazpkg/packages.md5 | head -4
f4dec8eae438fdc13dfcbe08ba54d789  firefox-17.0.8esr.tazpkg
2f4c0bd32f3a128a82ad6a6537af7394  firefox-dev-17.0.8esr.tazpkg
0e17d413a3f8e8b963e2248ef576313a  firefox-langpack-da-17.0.8esr.tazpkg
092102b0652ccfc9d1170b27b1801528  firefox-langpack-de-17.0.8esr.tazpkg

root@slitaz:/home/tux# md5sum firefox-17.0.9esr.tazpkg
e392feddf2ab47ec12c2659a248b9a66  firefox-17.0.9esr.tazpkg
root@slitaz:/home/tux#


5.
http://mirror.slitaz.org/packages/cooking/
[..]
ID    2013-Oct-13 00:46:03    0.0K    application/octet-stream
ORBit2-2.14.19.tazpkg    2013-Sep-21 16:57:31    145.7K    application/x-tazpkg
[..]
firefox-17.0.9esr.tazpkg    2013-Sep-27 05:15:30    15.5M    application/x-tazpkg
firefox-dev-17.0.9esr.tazpkg    2013-Sep-27 05:18:32    11.5M    application/x-tazpkg
firefox-langpack-da-17.0.9esr.tazpkg    2013-Sep-27 08:45:36    204.8K    application/x-tazpkg
firefox-langpack-de-17.0.9esr.tazpkg    2013-Sep-27 08:45:43    208.6K    application/x-tazpkg
firefox-langpack-en_GB-17.0.9esr.tazpkg    2013-Sep-27 08:45:50    201.9K    application/x-tazpkg
firefox-langpack-es_ES-17.0.9esr.tazpkg    2013-Sep-27 08:45:57    176.8K    application/x-tazpkg
firefox-langpack-fr-17.0.9esr.tazpkg    2013-Sep-27 08:46:03    207.1K    application/x-tazpkg
firefox-langpack-id-17.0.9esr.tazpkg    2013-Sep-27 08:46:10    205.2K    application/x-tazpkg
firefox-langpack-it-17.0.9esr.tazpkg    2013-Sep-27 08:46:18    170.8K    application/x-tazpkg
firefox-langpack-pt_BR-17.0.9esr.tazpkg    2013-Sep-27 08:46:24    208.3K    application/x-tazpkg
firefox-langpack-pt_PT-17.0.9esr.tazpkg    2013-Sep-27 08:46:32    212.2K    application/x-tazpkg
firefox-langpack-ru-17.0.9esr.tazpkg    2013-Sep-27 08:46:40    181.2K    application/x-tazpkg
firefox-langpack-zh_CN-17.0.9esr.tazpkg    2013-Sep-27 08:46:47    208.3K    application/x-tazpkg
firefox-langpack-zh_TW-17.0.9esr.tazpkg    2013-Sep-27 08:46:56    208.7K    application/x-tazpkg
firefox.flavor    2013-Oct-13 00:52:20    6.5K    application/x-flavor
[..]
packages.desc    2013-Aug-10 08:55:45    429.6K    text/plain
packages.equiv    2013-Aug-10 08:55:43    5.8K    text/plain
packages.list    2013-Aug-10 08:43:43    73.7K    text/plain
packages.md5    2013-Aug-10 08:50:28    238.3K    text/plain
packages.txt    2013-Aug-10 08:55:45    333.7K    text/plain

2013-10-05

Slitaz -- apply_patchs()



1.  Apply patches
apply_patchs()
{
    cd $src
    while read patch_file; do
        [ -f done.$patch_file ] && continue
        echo "Apply $patch_file..."
        patch -p1 < $stuff/patches/$patch_file || return 1
    touch done.$patch_file
    done <<EOT
remove-selinux-android.patch
use-capability.patch
reboot-syscall.patch
env-props.patch
adbd-use-user-shell.patch
use-local-socket.patch
EOT
}


2.  ls -1 done*
done.adbd-use-user-shell.patch
done.env-props.patch
done.reboot-syscall.patch
done.remove-selinux-android.patch
done.use-capability.patch
done.use-local-socket.patch


 3.  logfile
....
Apply remove-selinux-android.patch...
patching file extras/ext4_utils/make_ext4fs.c
patching file extras/ext4_utils/make_ext4fs_main.c
Apply use-capability.patch...
patching file core/include/private/android_filesystem_config.h
Apply reboot-syscall.patch...
patching file core/libcutils/android_reboot.c
Apply env-props.patch...
patching file core/adb/env-props.c
Apply adbd-use-user-shell.patch...
patching file core/adb/services.c
Apply use-local-socket.patch...
patching file core/adb/adb.c
patching file core/adb/adb_client.c
patching file core/adb/transport_local.c



----
# SliTaz package receipt.

PACKAGE="android-tools-adbd"
VERSION="4.2.2"
CATEGORY="development"
SHORT_DESC="Android Debug Bridge daemon"
MAINTAINER="alanyih"
WEB_SITE="http://developer.android.com/guide/developing/tools/adb.html"
TARBALL="android-tools_4.2.2+git20130529.orig.tar.xz"
WGET_URL="http://ftp.de.debian.org/debian/pool/main/a/android-tools/$TARBALL"

DEPENDS="libssl zlib libcap"
BUILD_DEPENDS="openssl-dev zlib-dev libcap-dev"

# Apply patches
apply_patchs()
{
    cd $src
    while read patch_file; do
        [ -f done.$patch_file ] && continue
        echo "Apply $patch_file..."
        patch -p1 < $stuff/patches/$patch_file || return 1
    touch done.$patch_file
    done <<EOT
remove-selinux-android.patch
use-capability.patch
reboot-syscall.patch
env-props.patch
adbd-use-user-shell.patch
use-local-socket.patch
EOT
}

# Rules to configure and make the package.
compile_rules()
{
   apply_patchs &&
   cd core/adb
   cp -a $stuff/adbdMakefile Makefile
   make
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
   mkdir -p $fs/usr/bin
   cp -a $src/core/adb/adbd $fs/usr/bin
}