Size: 26950
Comment:
|
Size: 27138
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 57: | Line 57: |
* mkdir -p /tmp/vgbox * cd /tmp/vgbox * wget http://files.vagrantup.com/lucid32.box #Ubuntu 10.04 LTS (big file with the whole VM) * vagrant box add UbuntuLucid32 lucid32.box # associate the VM file with an alias * vagrant init UbuntuLucid32 * vagrant up * vagrant ssh #access the VM through SSH * ping www.sapo.pt #inside VM ... does not reply * exit * vagrant suspend |
{{{#!highlight sh mkdir -p /tmp/vgbox cd /tmp/vgbox wget http://files.vagrantup.com/lucid32.box #Ubuntu 10.04 LTS (big file with the whole VM) vagrant box add UbuntuLucid32 lucid32.box # associate the VM file with an alias vagrant init UbuntuLucid32 vagrant up vagrant ssh #access the VM through SSH ping www.sapo.pt #inside VM ... does not reply exit vagrant suspend }}} |
Line 69: | Line 71: |
* VBoxManage list vms * VBoxManage modifyvm "vgbox_1372194938" --natdnsproxy1 on * VBoxManage modifyvm "vgbox_1372194938" --natdnshostresolver1 on * vagrant resume * vagrant ssh * ping www.sapo.pt # OK ! it gets ping replies * dpkg -l | more # show all installed packages |
{{{#!highlight sh VBoxManage list vms VBoxManage modifyvm "vgbox_1372194938" --natdnsproxy1 on VBoxManage modifyvm "vgbox_1372194938" --natdnshostresolver1 on vagrant resume vagrant ssh ping www.sapo.pt # OK ! it gets ping replies dpkg -l | more # show all installed packages }}} |
Line 93: | Line 97: |
* mkdir -p ~/Downloads/vagrantBoxes/ * cd ~/Downloads/vagrantBoxes/ * wget http://files.vagrantup.com/precise32.box #Ubuntu 12.04 LTS * mkdir -p /tmp/precise32 * cd /tmp/precise32 * vagrant box add UbuntuPrecise32 ~/Downloads/vagrantBoxes/precise32.box * vagrant init UbuntuPrecise32 * vagrant up * vagrant ssh #access the VM through SSH * ping www.sapo.pt * exit * vagrant suspend |
{{{#!highlight sh mkdir -p ~/Downloads/vagrantBoxes/ cd ~/Downloads/vagrantBoxes/ wget http://files.vagrantup.com/precise32.box #Ubuntu 12.04 LTS mkdir -p /tmp/precise32 cd /tmp/precise32 vagrant box add UbuntuPrecise32 ~/Downloads/vagrantBoxes/precise32.box vagrant init UbuntuPrecise32 vagrant up vagrant ssh #access the VM through SSH ping www.sapo.pt exit vagrant suspend }}} |
Line 153: | Line 158: |
* iptables -F * iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE |
{{{#!highlight sh iptables -F iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE }}} |
Line 157: | Line 164: |
* iptables -L -t nat -v * iptables -L -t filter -v {{{#!highligth bash |
{{{#!highlight sh iptables -L -t nat -v iptables -L -t filter -v }}} {{{#!highligth sh |
Line 173: | Line 182: |
* route -n | {{{#!highlight sh route -n }}} |
Line 177: | Line 188: |
* route del -net 0.0.0.0 gw 192.168.1.1 | {{{#!highlight sh route del -net 0.0.0.0 gw 192.168.1.1 }}} |
Line 182: | Line 195: |
* route add default gw 192.168.1.123 * route -n |
{{{#!highlight sh route add default gw 192.168.1.123 route -n }}} |
Line 195: | Line 210: |
* route print * route delete 0.0.0.0 * route add 0.0.0.0 192.168.1.123 |
{{{#!highlight sh route print route delete 0.0.0.0 route add 0.0.0.0 192.168.1.123 }}} |
Line 202: | Line 219: |
{{{ | {{{#!highlight sh |
Line 224: | Line 241: |
$VBoxManage convertfromraw -format VDI usbboot.img usbboot.vdi | {{{#!highlight sh VBoxManage convertfromraw -format VDI usbboot.img usbboot.vdi }}} |
Line 227: | Line 246: |
* /usr/share/mkinitrd/mkinitrd_command_generator.sh * mkinitrd -c -k 3.2.29 -f ext4 -r /dev/sda5 -m usbhid:ehci-hcd:mbcache:jbd2:ext4 -u -o /boot/initrd.gz |
{{{#!highlight sh /usr/share/mkinitrd/mkinitrd_command_generator.sh mkinitrd -c -k 3.2.29 -f ext4 -r /dev/sda5 -m usbhid:ehci-hcd:mbcache:jbd2:ext4 -u -o /boot/initrd.gz }}} |
Line 231: | Line 252: |
{{{ | {{{#!highlight sh |
Line 244: | Line 265: |
{{{#!highlight bash | {{{#!highlight sh |
Line 289: | Line 310: |
{{{#!highlight bash | {{{#!highlight sh |
Line 374: | Line 395: |
* cd ~/Downloads/slack14i386patches * wget ftp://ftp.slackware.com/pub/slackware/slackware-14.0/patches/PACKAGES.TXT * cat PACKAGES.TXT | grep "PACKAGE NAME" | awk '//{print $3}'| sed 's/.txz//g' | xargs -i ls /var/log/packages/{} &> /tmp/out.txt ;mkdir -p /tmp/packages;cd /tmp/packages; cat /tmp/out.txt | grep cannot | awk '//{print $4}' | sed 's/\/var\/log\/packages\///g' | sed 's/://g' | xargs -i wget ftp://ftp.slackware.com/pub/slackware/slackware-14.0/patches/packages/{}.txz |
{{{#!highlight sh cd ~/Downloads/slack14i386patches wget ftp://ftp.slackware.com/pub/slackware/slackware-14.0/patches/PACKAGES.TXT cat PACKAGES.TXT | grep "PACKAGE NAME" | awk '//{print $3}'| sed 's/.txz//g' | xargs -i ls /var/log/packages/{} &> /tmp/out.txt ;mkdir -p /tmp/packages;cd /tmp/packages; cat /tmp/out.txt | grep cannot | awk '//{print $4}' | sed 's/\/var\/log\/packages\///g' | sed 's/://g' | xargs -i wget ftp://ftp.slackware.com/pub/slackware/slackware-14.0/patches/packages/{}.txz }}} |
Line 432: | Line 454: |
* wget ftp://ftp.slackware.com/pub/slackware/slackware64-14.0/patches/packages/bash-4.2.048-x86_64-2_slack14.0.txz * upgradepkg bash-4.2.048-x86_64-2_slack14.0.txz |
{{{#!highlight sh wget ftp://ftp.slackware.com/pub/slackware/slackware64-14.0/patches/packages/bash-4.2.048-x86_64-2_slack14.0.txz upgradepkg bash-4.2.048-x86_64-2_slack14.0.txz }}} |
Line 436: | Line 460: |
* ctrl+alt+f1 * mount /dev/cdrom /mnt/cdrom * cd /mnt/cdrom * cp slackware /root/ -r * cd /root * telninit 1 * login as root * cd /root/slackware * upgradepkg a/glibc-solibs-*.t?z * upgradepkg a/pkgtools-*.tgz * upgradepkg a/tar-*.tgz * upgradepkg a/xz-*.tgz * upgradepkg a/findutils-*.txz * upgradepkg --install-new /root/slackware/*/*.t?z * removepkg Terminal aumix kdegames kdemultimedia ksecrets mysql printer-applet quanta rexima scim-bridge xxgdb * Check file /etc/lilo.conf to see which old kernel is used #/boot/vmlinuz-generic-smp-3.2.45-smp * /usr/share/mkinitrd/mkinitrd_command_generator.sh -k 3.10.17-smp | bash * In /etc/lilo.conf use image=/boot/vmlinuz-generic-smp-3.10.17-smp * lilo -v * telinit 3 * reboot * After the reboot shows the kernel version 3.10.17 * In /etc/rc.d/rc.local add modprobe snd_mixer_oss |
{{{#!highlight sh # ctrl+alt+f1 mount /dev/cdrom /mnt/cdrom cd /mnt/cdrom cp slackware /root/ -r cd /root telninit 1 # login as root cd /root/slackware upgradepkg a/glibc-solibs-*.t?z upgradepkg a/pkgtools-*.tgz upgradepkg a/tar-*.tgz upgradepkg a/xz-*.tgz upgradepkg a/findutils-*.txz upgradepkg --install-new /root/slackware/*/*.t?z removepkg Terminal aumix kdegames kdemultimedia ksecrets mysql printer-applet quanta rexima scim-bridge xxgdb # Check file /etc/lilo.conf to see which old kernel is used #/boot/vmlinuz-generic-smp-3.2.45-smp /usr/share/mkinitrd/mkinitrd_command_generator.sh -k 3.10.17-smp | bash # In /etc/lilo.conf use image=/boot/vmlinuz-generic-smp-3.10.17-smp lilo -v telinit 3 reboot # After the reboot shows the kernel version 3.10.17 # In /etc/rc.d/rc.local add modprobe snd_mixer_oss }}} |
Line 465: | Line 491: |
* mkdir -p ~/Downloads/slack14_1i386patches * cd ~/Downloads/slack14_1i386patches * wget ftp://ftp.slackware.com/pub/slackware/slackware-14.1/patches/PACKAGES.TXT |
{{{#!highlight sh mkdir -p ~/Downloads/slack14_1i386patches cd ~/Downloads/slack14_1i386patches wget ftp://ftp.slackware.com/pub/slackware/slackware-14.1/patches/PACKAGES.TXT |
Line 469: | Line 496: |
* cd /tmp/packages * mv * ~/Downloads/slack14_1i386patches |
cd /tmp/packages mv * ~/Downloads/slack14_1i386patches }}} |
Line 475: | Line 502: |
* wget http://ftp.slackware.com/pub/slackware-iso/slackware-14.2-iso/slackware-14.2-install-dvd.iso * modprobe sg # fpr cdrecord * cdrecord -scanbus #identify the device DVDRAM LG GP08NU6B * cdrecord -dev=6,0,0 -pad -data slackware-14.2-install-dvd.iso * # eject the DVD after burning * cd / * mount /dev/sr0 /mnt/cdrom #check DVD * cd /mnt/cdrom * ls * cd / * umount /mnt/cdrom |
{{{#!highlight sh wget http://ftp.slackware.com/pub/slackware-iso/slackware-14.2-iso/slackware-14.2-install-dvd.iso modprobe sg # fpr cdrecord cdrecord -scanbus #identify the device DVDRAM LG GP08NU6B cdrecord -dev=6,0,0 -pad -data slackware-14.2-install-dvd.iso # eject the DVD after burning cd / mount /dev/sr0 /mnt/cdrom #check DVD cd /mnt/cdrom ls cd / umount /mnt/cdrom }}} |
Line 487: | Line 517: |
{{{#!highlight bash | {{{#!highlight sh |
Line 551: | Line 581: |
* cd /tmp * wget https://slackbuilds.org/slackbuilds/14.2/development/ninja.tar.gz * tar xvzf ninja.tar.gz * cd ninja * wget https://github.com/ninja-build/ninja/archive/v1.7.1.tar.gz * ./ninja.SlackBuild * installpkg /tmp/ninja-1.7.1-i486-1_SBo.tgz * cd .. * wget https://slackbuilds.org/slackbuilds/14.2/network/chromium.tar.gz * tar xvzf chromium.tar.gz * cd chromium * wget https://commondatastorage.googleapis.com/chromium-browser-official/chromium-48.0.2564.97.tar.xz #about 413MB * ./chromium.SlackBuild |
{{{#!highlight sh cd /tmp wget https://slackbuilds.org/slackbuilds/14.2/development/ninja.tar.gz tar xvzf ninja.tar.gz cd ninja wget https://github.com/ninja-build/ninja/archive/v1.7.1.tar.gz ./ninja.SlackBuild installpkg /tmp/ninja-1.7.1-i486-1_SBo.tgz cd .. wget https://slackbuilds.org/slackbuilds/14.2/network/chromium.tar.gz tar xvzf chromium.tar.gz cd chromium wget https://commondatastorage.googleapis.com/chromium-browser-official/chromium-48.0.2564.97.tar.xz #about 413MB ./chromium.SlackBuild }}} |
Line 566: | Line 598: |
* wget http://download.virtualbox.org/virtualbox/5.1.4/VirtualBox-5.1.4-110228-Linux_x86.run | {{{#!highlight sh wget http://download.virtualbox.org/virtualbox/5.1.4/VirtualBox-5.1.4-110228-Linux_x86.run }}} |
Line 568: | Line 603: |
* cd <place where the downloaded virtualbox installer is> * chmod 755 VirtualBox-5.1.4-110228-Linux_x86.run * ./VirtualBox-5.1.4-110228-Linux_x86.run * usermod -a -G vboxusers <username> * id <username> #check user groups |
{{{#!highlight sh cd <place where the downloaded virtualbox installer is> chmod 755 VirtualBox-5.1.4-110228-Linux_x86.run ./VirtualBox-5.1.4-110228-Linux_x86.run usermod -a -G vboxusers <username> id <username> #check user groups }}} |
Line 575: | Line 612: |
* virtualbox --help # check the version and parameters * virtualbox #start virtualbox |
{{{#!highlight sh virtualbox --help # check the version and parameters virtualbox #start virtualbox }}} |
Slackware
The original Linux distribution, geared towards power and stability.
Vagrant on Slackware 14 32 bit
Ruby version: ruby 1.9.3p429 (2013-05-15 revision 40747) [x86_64-linux]
VirtualBox version, Oracle VM VirtualBox Manager 4.2.8
Install Vagrant from source
Based on https://github.com/mitchellh/vagrant/wiki/Installing-Vagrant-from-source
As root run the following:
1 cd /tmp
2 mkdir gitVagrant
3 cd gitVagrant
4 git clone https://github.com/mitchellh/vagrant.git
5 cd vagrant
6 git pull origin master #get latest version
7 #git reset a40522f5fabccb9ddabad03d836e120ff5d14093 --hard # reset to v1.3.5
8 git reset 7ec0ee1d00a916f80b109a298bab08e391945243 --hard #reset to v1.2.7
9 gem install bundle #it may not be installed
10 bundle install
11 rake install
12 gem list
13 gem uninstall vagrant #uninstall other old gems
14 vagrant -v #check vagrant version
15
Install VirtualBox on Slackware 14 32 bit
Get VirtualBox 4.2.8 for Linux, i386, all distributions http://download.virtualbox.org/virtualbox/4.2.8/VirtualBox-4.2.8-83876-Linux_x86.run.
For 4.2.18 http://download.virtualbox.org/virtualbox/4.2.18/VirtualBox-4.2.18-88781-Linux_x86.run
As root run the following commands:
As a normal user run the following:
Get and run a base box - Ubuntu Lucid32
In http://www.vagrantbox.es/ there is a list of available vagrant boxes.
As normal user run the following
1 mkdir -p /tmp/vgbox
2 cd /tmp/vgbox
3 wget http://files.vagrantup.com/lucid32.box #Ubuntu 10.04 LTS (big file with the whole VM)
4 vagrant box add UbuntuLucid32 lucid32.box # associate the VM file with an alias
5 vagrant init UbuntuLucid32
6 vagrant up
7 vagrant ssh #access the VM through SSH
8 ping www.sapo.pt #inside VM ... does not reply
9 exit
10 vagrant suspend
Run the following as stated in http://serverfault.com/questions/453185/vagrant-virtualbox-dns-10-0-2-3-not-working:
Running cat /etc/debian_version show its based on squeeze/sid.
Running cat /etc/issue.net show it's Ubuntu 10.04.4 LTS http://releases.ubuntu.com/lucid/.
Current user and pass for the lucid32 box is vagrant vagrant. To get superuser access run sudo bash.
Inspecting the file /etc/shadow we can see that only the user vagrant has a password defined.
In /etc/sudoers it is said that all users belonging to group can gain root privileges with supplying a password.
In /etc/group it is stated that vagrant belongs to the admin group.
Ubuntu Precise32
In http://www.vagrantbox.es/ there is a list of available vagrant boxes.
As normal user run the following
1 mkdir -p ~/Downloads/vagrantBoxes/
2 cd ~/Downloads/vagrantBoxes/
3 wget http://files.vagrantup.com/precise32.box #Ubuntu 12.04 LTS
4 mkdir -p /tmp/precise32
5 cd /tmp/precise32
6 vagrant box add UbuntuPrecise32 ~/Downloads/vagrantBoxes/precise32.box
7 vagrant init UbuntuPrecise32
8 vagrant up
9 vagrant ssh #access the VM through SSH
10 ping www.sapo.pt
11 exit
12 vagrant suspend
Slackware NAT router with Pen 3G
Configure Slackware PC to share a 3G internet connection (TMN portuguese ISP).
Internet connection
The used APN is internet.
There is no PIN defined in the used SIM card.
Edit /etc/ppp/peers/tmnpub
- /dev/ttyUSB0
- 460800
- connect 'chat -v -f /etc/ppp/chat/tmnpub'
- defaultroute
- usepeerdns
Edit /etc/ppp/chat/tmnpub
- ABORT 'BUSY'
- ABORT 'NO CARRIER'
- ABORT 'ERROR'
- ABORT 'SIM PIN'
- ABORT 'SIM PUK'
'' AT
- OK AT+CGDCONT=1,"IP","internet"
- OK AT+CPIN?
- READY ATDT*99#
- CONNECT
To connect to the internet we must use the command:
- pppd call tmnpub
Using the command ifconfig we should see the device ppp0 in the output.
Issuing a command ping www.google.com we should get a reply with the IP address from Google.
Configure NAT (Network Address Translation) router
Translate internal network addresses (source address) to a public/usable IP address given to the 3G modem.
View the routing table:
- route -n
It should appear the devices ppp0 and eth0, and based on the Destination and Netmask the destination interface.
Enable IP forwarding:
echo 1 > /proc/sys/net/ipv4/ip_forward
Configure iptables to translate the address after they are forwarded to the correct interface, from eth0 to ppp0:
To view the iptables configuration run the commands:
#script #Enable IP forwarding: echo 1 > /proc/sys/net/ipv4/ip_forward #Configure iptables to translate the address after they are forwarded to the correct interface, from eth0 to ppp0: iptables -F iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
Configure client computer
The routing table must be configure to use the NAT on Slackware, that will act as a router.
Check the current default gateway:
1 route -n
The line with destination equal to 0.0.0.0 and gateway 0.0.0.0, is the default router/gateway and must be deleted. We must run a command to do that, adapted to the current situation:
1 route del -net 0.0.0.0 gw 192.168.1.1
The previous command is to delete a route with destination 0.0.0.0 and gateway 192.168.1.1.
If the NAT router have the IP 192.168.1.123 then the following command must be sent:
After that running route -n should return a line with:
- Gateway: 192.168.1.123
- Netmask: 0.0.0.0
- Destination: 0.0.0.0
- Iface: eth0
Running a ping www.google.com from the client computer should return the IP address from Google.
Running a traceroute www.google.com should show the IP address from the NAT router.
Windows
Generic kernel
The “generic” kernel on the other hand, is a kernel which has virtually no drivers built in. All drivers will be loaded into RAM on demand.
1 #/usr/share/mkinitrd/mkinitrd_command_generator.sh
2 #
3 # mkinitrd_command_generator.sh revision 1.45
4 #
5 # This script will now make a recommendation about the command to use
6 # in case you require an initrd image to boot a kernel that does not
7 # have support for your storage or root filesystem built in
8 # (such as the Slackware 'generic' kernels').
9 # A suitable 'mkinitrd' command will be:
10
11 mkinitrd -c -k 3.2.45-smp -f ext4 -r /dev/sda1 -m usb-storage:ehci-hcd:usbhid:uhci-hcd:mbcache:jbd2:ext4 -u -o /boot/initrd.gz
12 # Add to /etc/lilo.conf
13 image = /boot/vmlinuz-generic-smp-3.2.45-smp
14 initrd = /boot/initrd.gz # add this line so that lilo sees initrd.gz
15 root = /dev/sda1
16 label = SlackwareGeneric
17 read-only
18 # run lilo -v
19
USB boot in VirtualBox
1 VBoxManage convertfromraw -format VDI usbboot.img usbboot.vdi
Generic on Slackware64 14.0
Add to /etc/lilo.conf
- lilo -v
System V (Sys V) init
Slackware since 7.0 also allows Sys V inits.
Sample service /etc/init.d/blah:
1 #! /bin/sh
2 # /etc/init.d/blah
3 #
4
5 # Some things that run always
6 touch /var/lock/blah
7
8 # Carry out specific functions when asked to by the system
9 case "$1" in
10 start)
11 echo "Starting script blah "
12 echo "Could do more here"
13 ;;
14 stop)
15 echo "Stopping script blah"
16 echo "Could do more here"
17 ;;
18 *)
19 echo "Usage: /etc/init.d/blah {start|stop}"
20 exit 1
21 ;;
22 esac
23
24 exit 0
Mark script as executable:
- chmod 755 /etc/init.d/blah
Default runlevels (2 3 4 5):
- ln -s /etc/init.d/blah /etc/rc2.d/S99blah
- ln -s /etc/init.d/blah /etc/rc2.d/K10blah
- ln -s /etc/init.d/blah /etc/rc3.d/S99blah
- ln -s /etc/init.d/blah /etc/rc3.d/K10blah
- ln -s /etc/init.d/blah /etc/rc4.d/S99blah
- ln -s /etc/init.d/blah /etc/rc4.d/K10blah
- ln -s /etc/init.d/blah /etc/rc5.d/S99blah
- ln -s /etc/init.d/blah /etc/rc5.d/K10blah
Check symbolic links:
- ls /etc/rc*.d
Sys V init for Python script
Sample service /etc/init.d/blah:
1 #! /bin/sh
2 # /etc/init.d/blah
3 #
4
5 # Some things that run always
6 touch /var/lock/blah
7
8 # Carry out specific functions when asked to by the system
9 case "$1" in
10 start)
11 logger "Starting beat.py"
12 echo "Starting beat.py"
13 /usr/bin/python /tmp/beat.py &
14 ;;
15 status)
16 PID=`cat /var/run/beat.pid`
17 logger "Process running with PID $PID"
18 echo "Process running with PID $PID"
19 ;;
20 stop)
21 PID=`cat /var/run/beat.pid`
22 logger "Killing process with PID $PID"
23 echo "Killing process with PID $PID"
24 kill -9 $PID
25 rm /var/run/beat.pid
26 ;;
27 *)
28 echo "Usage: /etc/init.d/blah {start|status|stop}"
29 exit 1
30 ;;
31 esac
32
33 exit 0
Mark script as executable:
- chmod 755 /etc/init.d/blah
Default runlevels (2 3 4 5):
- ln -s /etc/init.d/blah /etc/rc2.d/S99blah
- ln -s /etc/init.d/blah /etc/rc2.d/K10blah
- ln -s /etc/init.d/blah /etc/rc3.d/S99blah
- ln -s /etc/init.d/blah /etc/rc3.d/K10blah
- ln -s /etc/init.d/blah /etc/rc4.d/S99blah
- ln -s /etc/init.d/blah /etc/rc4.d/K10blah
- ln -s /etc/init.d/blah /etc/rc5.d/S99blah
- ln -s /etc/init.d/blah /etc/rc5.d/K10blah
Check symbolic links:
- ls /etc/rc*.d
Python /tmp/beat.py code:
1 #!/usr/bin/python
2 import threading
3 import time
4 import os
5 import syslog
6 import datetime
7
8 class Beat(threading.Thread):
9 def __init__(self):
10 threading.Thread.__init__(self) #required
11
12 def run(self):
13 loop=True
14 while loop:
15 syslog.syslog(syslog.LOG_INFO, "Beat %s"%(datetime.datetime.now()) )
16 time.sleep(5)
17
18 if __name__=="__main__":
19 f=open('/var/run/beat.pid','wa')
20 f.write('%d'%(os.getpid()))
21 f.close()
22 os.getpid()
23 b = Beat()
24 b.start()
Packages updates
Check patches/packages and patches/PACKAGES.TXT for the desired Slackware version. URL for Slackware 14.0 ftp://ftp.slackware.com/pub/slackware/slackware-14.0/patches/
Get packages to be updated
1 cd ~/Downloads/slack14i386patches
2 wget ftp://ftp.slackware.com/pub/slackware/slackware-14.0/patches/PACKAGES.TXT
3 cat PACKAGES.TXT | grep "PACKAGE NAME" | awk '//{print $3}'| sed 's/.txz//g' | xargs -i ls /var/log/packages/{} &> /tmp/out.txt ;mkdir -p /tmp/packages;cd /tmp/packages; cat /tmp/out.txt | grep cannot | awk '//{print $4}' | sed 's/\/var\/log\/packages\///g' | sed 's/://g' | xargs -i wget ftp://ftp.slackware.com/pub/slackware/slackware-14.0/patches/packages/{}.txz
Caching only nameserver/DNS server
- chmod 755 /etc/rc.d/rc.bind
Check the configuration with named-checkconf.
- Start the service with /etc/rc.d/rc.bind start
Edit /etc/resolv.conf
nameserver 127.0.0.1
Edit /etc/named.conf
options { directory "/var/named"; forwarders { 8.8.8.8; 8.8.4.4; }; }; // a caching only nameserver config zone "." IN { type hint; file "caching-example/named.root"; }; zone "localhost" IN { type master; file "caching-example/localhost.zone"; allow-update { none; }; }; zone "0.0.127.in-addr.arpa" IN { type master; file "caching-example/named.local"; allow-update { none; }; }; logging { channel my_named_channel { file "/tmp/named.log"; // syslog info; // Set the severity to dynamic to see all the debug messages. severity dynamic; print-time yes; print-severity yes; print-category yes; }; category queries { my_named_channel; }; category client { my_named_channel; }; category default { default_syslog; }; };
Update bash on Slackware64 14
Upgrade from Slackware 14.0 to 14.1
1 # ctrl+alt+f1
2 mount /dev/cdrom /mnt/cdrom
3 cd /mnt/cdrom
4 cp slackware /root/ -r
5 cd /root
6 telninit 1
7 # login as root
8 cd /root/slackware
9 upgradepkg a/glibc-solibs-*.t?z
10 upgradepkg a/pkgtools-*.tgz
11 upgradepkg a/tar-*.tgz
12 upgradepkg a/xz-*.tgz
13 upgradepkg a/findutils-*.txz
14 upgradepkg --install-new /root/slackware/*/*.t?z
15 removepkg Terminal aumix kdegames kdemultimedia ksecrets mysql printer-applet quanta rexima scim-bridge xxgdb
16 # Check file /etc/lilo.conf to see which old kernel is used #/boot/vmlinuz-generic-smp-3.2.45-smp
17 /usr/share/mkinitrd/mkinitrd_command_generator.sh -k 3.10.17-smp | bash
18 # In /etc/lilo.conf use image=/boot/vmlinuz-generic-smp-3.10.17-smp
19 lilo -v
20 telinit 3
21 reboot
22 # After the reboot shows the kernel version 3.10.17
23 # In /etc/rc.d/rc.local add modprobe snd_mixer_oss
24
Get patches for Slackware 14.1
- Check patches/packages and patches/PACKAGES.TXT for the desired Slackware version.
URL for Slackware 14.1 ftp://ftp.slackware.com/pub/slackware/slackware-14.1/patches/
Get packages to be updated
1 mkdir -p ~/Downloads/slack14_1i386patches
2 cd ~/Downloads/slack14_1i386patches
3 wget ftp://ftp.slackware.com/pub/slackware/slackware-14.1/patches/PACKAGES.TXT
4 cat PACKAGES.TXT | grep "PACKAGE NAME" | awk '//{print $3}'| sed 's/.txz//g' | xargs -i ls /var/log/packages/{} &> /tmp/out.txt ;mkdir -p /tmp/packages;cd /tmp/packages; cat /tmp/out.txt | grep cannot | awk '//{print $4}' | sed 's/\/var\/log\/packages\///g' | sed 's/://g' | xargs -i wget ftp://ftp.slackware.com/pub/slackware/slackware-14.1/patches/packages/{}.txz
5 cd /tmp/packages
6 mv * ~/Downloads/slack14_1i386patches
Upgrade from 14.1 to 14.2
Get and burn ISO
1 wget http://ftp.slackware.com/pub/slackware-iso/slackware-14.2-iso/slackware-14.2-install-dvd.iso
2 modprobe sg # fpr cdrecord
3 cdrecord -scanbus #identify the device DVDRAM LG GP08NU6B
4 cdrecord -dev=6,0,0 -pad -data slackware-14.2-install-dvd.iso
5 # eject the DVD after burning
6 cd /
7 mount /dev/sr0 /mnt/cdrom #check DVD
8 cd /mnt/cdrom
9 ls
10 cd /
11 umount /mnt/cdrom
Upgrade script
1 #!/bin/sh
2 #CURRDIR=`cd`
3 CURRDIR=`pwd`
4 URL=http://ftp.rnl.tecnico.ulisboa.pt/pub/slackware/slackware-14.2
5 PACKAGEURL=packagesUrl.txt
6 LOCATIONS=locations.txt
7
8 # get packages
9 function getpackages
10 {
11 cd /tmp
12 mkdir -p slack14_2
13 cd slack14_2
14 wget $URL/UPGRADE.TXT
15 wget $URL/slackware/PACKAGES.TXT
16 cat PACKAGES.TXT | grep 'NAME\|LOCATION' | tr -d '\n' | sed 's/PACKAGE NAME:/\n/g' | sed 's/PACKAGE LOCATION://g' | awk '/slackware/{print $2 , "/" , $1}' | sed 's/ \/ /\//g' | sort | sed "s/\.\/slack/http:\/\/ftp.rnl.tecnico.ulisboa.pt\/pub\/slackware\/slackware-14.2\/slack/g" > $PACKAGEURL
17
18 cat PACKAGES.TXT | grep 'LOCATION' | sort | uniq | sed "s/PACKAGE LOCATION: \.//g" > $LOCATIONS
19 cat $PACKAGEURL | xargs -i wget {}
20 }
21
22 # upgrade stuff
23 function upgrade
24 {
25 # must be in single user mode !!!
26 # telinit 1
27 cd /tmp/slack14_2
28 echo Backup /etc
29 tar cvzf backetc14_3.tgz /etc
30
31 echo Initial install
32 upgradepkg glibc-solibs-*.txz
33 upgradepkg pkgtools-*.txz
34 upgradepkg tar-*.txz
35 upgradepkg xz-*.txz
36 upgradepkg findutils-*.txz
37
38 echo Install other stuff
39 upgradepkg --install-new *.t?z
40
41 echo Remove old packages
42 removepkg ConsoleKit apmd bluez-hcidump cxxlibs foomatic-filters gnome-icon-theme imlib kdeadmin kdenetwork kdesdk kdetoys kwallet lesstif libelf libjpeg libxfcegui4 networkmanagement obex-data-server obexfs open-cobol oxygen-gtk3 phonon-mplayer phonon-xine pil portmap procps qca-cyrus-sasl qca-gnupg qca-ossl udev xchat xf86-input-aiptek xf86-video-modesetting xfce4-mixer xfce4-volumed xfwm4-themes
43
44 echo Configure kernel
45 /usr/share/mkinitrd/mkinitrd_command_generator.sh -k 4.4.14-smp | bash
46
47 echo Check lilo.conf to point to 4.4.14-smp in image=
48 cat /etc/lilo.conf | grep image
49 echo Run lilo
50 lilo
51 echo Probable error above if image does not have the kernel 4.4.14-smp
52 telinit 3
53 # reboot
54 # in case of problems to get a login in lilo after '''boot: SlackwareGen single''' to start in single user mode
55 # /etc/rc.d/rc.modules should point to rc.modules.new to use modules for 4.4.14
56 }
57
58 upgrade
59 echo $CURRDIR
60 cd $CURRDIR
Chromium
1 cd /tmp
2 wget https://slackbuilds.org/slackbuilds/14.2/development/ninja.tar.gz
3 tar xvzf ninja.tar.gz
4 cd ninja
5 wget https://github.com/ninja-build/ninja/archive/v1.7.1.tar.gz
6 ./ninja.SlackBuild
7 installpkg /tmp/ninja-1.7.1-i486-1_SBo.tgz
8 cd ..
9 wget https://slackbuilds.org/slackbuilds/14.2/network/chromium.tar.gz
10 tar xvzf chromium.tar.gz
11 cd chromium
12 wget https://commondatastorage.googleapis.com/chromium-browser-official/chromium-48.0.2564.97.tar.xz #about 413MB
13 ./chromium.SlackBuild
VirtualBox
1 wget http://download.virtualbox.org/virtualbox/5.1.4/VirtualBox-5.1.4-110228-Linux_x86.run
As root run the following commands:
As a normal user run the following:
BSD init script
/etc/rc.d/rc.beat #chmod 755 rc.beat
1 #! /bin/sh
2 # /etc/rc.d/rc.beat
3 #
4 PROC_NAME=beat
5 touch /var/lock/beat
6
7 case "$1" in
8 start)
9 logger "Starting ${PROC_NAME}"
10 echo "Starting ${PROC_NAME}"
11 /usr/bin/python /tmp/${PROC_NAME}.py &
12 ;;
13 status)
14 PID=$(cat /var/run/beat.pid)
15 logger "${PROC_NAME} running with PID $PID"
16 echo "${PROC_NAME} running with PID $PID"
17 ;;
18 stop)
19 PID=$(cat /var/run/beat.pid)
20 logger "Killing ${PROC_NAME} with PID $PID"
21 echo "Killing ${PROC_NAME} with PID $PID"
22 kill -9 $PID
23 rm /var/run/beat.pid
24 ;;
25 *)
26 echo "Usage: /etc/rc.d/beat {start|status|stop}"
27 exit 1
28 ;;
29 esac
30
31 exit 0
/tmp/beat.py
1 #!/usr/bin/python
2 import threading
3 import time
4 import os
5 import syslog
6 import datetime
7
8 class Beat(threading.Thread):
9 def __init__(self):
10 threading.Thread.__init__(self) #required
11
12 def run(self):
13 loop=True
14 while loop:
15 syslog.syslog(syslog.LOG_INFO, "Beat %s"%(datetime.datetime.now()) )
16 time.sleep(5)
17
18 if __name__=="__main__":
19 f=open('/var/run/beat.pid','wa')
20 f.write('%d'%(os.getpid()))
21 f.close()
22 os.getpid()
23 b = Beat()
24 b.start()
Pidgin-sipe build for Slackware 14.2
- cd /tmp
wget https://slackbuilds.org/slackbuilds/14.2/network/pidgin-sipe.tar.gz
- tar xvzf pidgin-sipe.tar.gz
- cd pidgin-sipe
wget http://downloads.sourceforge.net/sipe/pidgin-sipe-1.21.1.tar.xz
./pidgin-sipe.SlackBuild
- installpkg /tmp/pidgin-sipe-1.21.1-i586-1_SBo.tgz
Slackbuild pidgin-sipe-1.21.1-i586-1_SBo.tgz
pidgin-skype slackbuild
- cd /tmp
wget https://slackbuilds.org/slackbuilds/14.2/libraries/json-glib.tar.gz
- tar xvzf json-glib.tar.gz
- cd json-glib
wget http://ftp.acc.umu.se/pub/GNOME/sources/json-glib/1.0/json-glib-1.0.4.tar.xz
./json-glib.SlackBuild
- installpkg /tmp/json-glib-1.0.4-i486-1_SBo.tgz
- cd /tmp
wget https://slackbuilds.org/slackbuilds/14.2/network/pidgin-skypeweb.tar.gz
- tar xvzf pidgin-skypeweb.tar.gz
- cd pidgin-skypeweb
wget https://github.com/EionRobb/skype4pidgin/archive/1.1.tar.gz
./pidgin-skypeweb.SlackBuild
- installpkg /tmp/pidgin-skypeweb-1.1-i486-1_SBo.tgz
Slackbuils json-glib-1.0.4-i486-1_SBo.tgz pidgin-skypeweb-1.1-i486-1_SBo.tgz json-glib-1.0.4-x86_64-1_SBo.tgz pidgin-skypeweb-1.1-x86_64-1_SBo.tgz
Get patches for Slackware 14.2
- Check patches/packages and patches/PACKAGES.TXT for the desired Slackware version.
URL for Slackware 14.2 ftp://ftp.slackware.com/pub/slackware/slackware-14.2/patches/
Get packages to be updated
URL_PATCHES=ftp://ftp.slackware.com/pub/slackware/slackware-14.2/patches
- mkdir -p ~/Downloads/slack14_2i386patches
- cd ~/Downloads/slack14_2i386patches
- rm PACKAGES.TXT
- wget $URL_PATCHES/PACKAGES.TXT
- head PACKAGES.TXT
- rm /tmp/packages/*
cat PACKAGES.TXT | grep "PACKAGE NAME" | awk '//{print $3}'| sed 's/.txz//g' | xargs -i ls /var/log/packages/{} &> /tmp/outpatches.txt ;mkdir -p /tmp/packages;cd /tmp/packages; cat /tmp/outpatches.txt | grep cannot | awk '//{print $4}' | sed 's/\/var\/log\/packages\///g' | sed 's/://g' | sed "s/'//g" | xargs -i wget $URL_PATCHES/packages/{}.txz
- cd /tmp/packages
- su # run as root the upgradepkg
- # ls *.txz | xargs -i upgradepkg {}
- find /tmp/packages/*txz | xargs -i upgradepkg {}
- exit # return to normal user
- mv * ~/Downloads/slack14_2i386patches
Update kernel (4.4.14 to 4.4.172)
1 function get_packages
2 {
3 cd /tmp/packages
4 wget ftp://ftp.slackware.com/pub/slackware/slackware-14.2/patches/packages/linux-4.4.172/kernel-firmware-20190118_a8b75ca-noarch-1.txz
5 wget ftp://ftp.slackware.com/pub/slackware/slackware-14.2/patches/packages/linux-4.4.172/kernel-generic-4.4.172-i586-1.txz
6 wget ftp://ftp.slackware.com/pub/slackware/slackware-14.2/patches/packages/linux-4.4.172/kernel-generic-smp-4.4.172_smp-i686-1.txz
7 wget ftp://ftp.slackware.com/pub/slackware/slackware-14.2/patches/packages/linux-4.4.172/kernel-headers-4.4.172_smp-x86-1.txz
8 wget ftp://ftp.slackware.com/pub/slackware/slackware-14.2/patches/packages/linux-4.4.172/kernel-huge-4.4.172-i586-1.txz
9 wget ftp://ftp.slackware.com/pub/slackware/slackware-14.2/patches/packages/linux-4.4.172/kernel-huge-smp-4.4.172_smp-i686-1.txz
10 wget ftp://ftp.slackware.com/pub/slackware/slackware-14.2/patches/packages/linux-4.4.172/kernel-modules-4.4.172-i586-1.txz
11 wget ftp://ftp.slackware.com/pub/slackware/slackware-14.2/patches/packages/linux-4.4.172/kernel-modules-smp-4.4.172_smp-i686-1.txz
12 wget ftp://ftp.slackware.com/pub/slackware/slackware-14.2/patches/packages/linux-4.4.172/kernel-source-4.4.172_smp-noarch-1.txz
13 }
14
15 function update
16 {
17 cp /etc/lilo.conf /etc/lilo.conf.old20190222
18 ls /boot
19 cd /tmp/packages
20 upgradepkg kernel-*.txz
21 # uname -a says that it has a SMP kernel
22 /usr/share/mkinitrd/mkinitrd_command_generator.sh -k 4.4.172-smp | bash
23 ls /boot
24 cat /etc/lilo.conf | grep image
25 echo "Check content, image should have kernel 4.4.172"
26 read
27 echo "Going to execute lilo"
28 lilo
29 mv *.txz /home/user/Downloads/slack14_2i386patches
30 }
31
32 #get_packages
33 update
/etc/dhclient.conf
# dhclient.conf # # Configuration file for ISC dhclient (see 'man dhclient.conf') # send host-name = "hostx"
Toshiba NB200 and Samsung Monitor
Set nb200 monitor (LVDS1) on the left and Samsung on the right (VGA1)
- /usr/bin/xrandr --output LVDS1 --left-of VGA1
Slackware 15.0
http://www.slackware.com/announce/15.0.php (2022-02-02)
http://ftp.slackware.com/pub/slackware/slackware64-15.0/UPGRADE.TXT
http://ftp.slackware.com/pub/slackware/slackware-15.0/UPGRADE.TXT
The links above are for the Slackware file tree. If you already have Slackware 14.2 installed, you can use these files and follow the instructions in the UPGRADE.TXT document to upgrade your system to Slackware 15.0.
Update kernel to 4.4.301
- update_kernel_4_4_301.sh
1 BASE_URL=http://ftp.slackware.com/pub/slackware/slackware-14.2/patches/packages/linux-4.4.301/
2
3 function get_packages
4 {
5 cd /tmp/packages
6 wget $BASE_URL/kernel-generic-4.4.301-i586-1.txz
7 wget $BASE_URL/kernel-generic-smp-4.4.301_smp-i686-1.txz
8 wget $BASE_URL/kernel-headers-4.4.301_smp-x86-1.txz
9 wget $BASE_URL/kernel-huge-4.4.301-i586-1.txz
10 wget $BASE_URL/kernel-huge-smp-4.4.301_smp-i686-1.txz
11 wget $BASE_URL/kernel-modules-4.4.301-i586-1.txz
12 wget $BASE_URL/kernel-modules-smp-4.4.301_smp-i686-1.txz
13 wget $BASE_URL/kernel-source-4.4.301_smp-noarch-1.txz
14 }
15
16 function update
17 {
18 cp /etc/lilo.conf /etc/lilo.conf.old20220213
19 ls /boot
20 cd /tmp/packages
21 upgradepkg kernel-*.txz
22 # uname -a says that it has a SMP kernel
23 /usr/share/mkinitrd/mkinitrd_command_generator.sh -k 4.4.301-smp |
24 bash
25 ls /boot
26 cat /etc/lilo.conf | grep image
27 echo "Check content, image should have kernel 4.4.301"
28 read
29 echo "Going to execute lilo"
30 lilo
31 mv *.txz /home/vitor/Downloads/slack14_2i386patches
32 }
33
34 # get_packages
35 # update
36
Slackware docker image
1 docker run --rm -d -it --name slack15 liveslak/slackware cat
2 docker exec -it slack15 bash
3 # https://slackpkg.org/documentation.html
4 slackpkg update
5 slackpkg search python
6 slackpkg install python3 nano python-pip
7 # python3-3.9.16-x86_64-1_slack15.0.txz
8 python3 -V
9 cd /tmp/
10 wget https://slackbuilds.org/slackbuilds/15.0/development/amazon-corretto.tar.gz
11 tar xvzf amazon-corretto.tar.gz
12 cd amazon-corretto
13 wget https://corretto.aws/downloads/resources/17.0.4.8.1/amazon-corretto-17.0.4.8.1-linux-x64.tar.gz
14 sh amazon-corretto.SlackBuild
15 installpkg /tmp/amazon-corretto-17.0.4.8.1-x86_64-1_SBo.tgz
16 /usr/lib64/java/bin/java
17 /usr/lib64/java/bin/javac
18 PATH=$PATH:/usr/lib64/java/bin/
19 echo $PATH
20 export PATH
21 docker stop slack15