Size: 17382
Comment:
|
Size: 17391
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 374: | Line 374: |
cd /mnt |
Debian
Debian is a free operating system (OS) for your computer. An operating system is the set of basic programs and utilities that make your computer run.
All packages list
http://packages.debian.org/stable/allpackages
Sample service blah
File in /etc/init.d/blah with chmod 755:
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
Add service
- update-rc.d blah defaults
- update-rc.d blah defaults 20 80
- update-rc.d blah start 20 2 3 4 . start 30 5 . stop 80 0 1 6 .
Remove service
- update-rc.d -f blah remove
Check services status
- service --status-all
- service blah status
Install Debian Wheezy 32 bit
Base Install DW (Debian Wheezy)
In Virtualbox
- new,
- type linux
- version debian
- name DW
- memory size 512 MB,
- create virtual hard drive
- vdi type
- dynamically allocated
- 8 GB
- power on
- choose debian-7.3.0-i386-DVD-1.iso
- install
- language english
- country, other, europe, portugal
- locale united states
- keyboard portuguese
- hostname dw
- domain name example.org
- root password ********
- Real name Vitor
- username for account vitor
- password for vitor ********
- timezone Lisbon
- Partitioning method, guided, use entire disk and setup LVM
- use SCSI3 sda
- Separate /home /usr /var and tmp partitions
- Write the changes to disk and configure LVM yes
- Finish partitioning and write changes to disk
- write the changes to disk? yes
- scan another dvd or cd? no
- use a network mirror? no
- participate in the package usage survey? no
- software to install: SSH server, standard system utilities, continue
- install grub bootloader to the master boot record? yes
- installation complete, continue
- reboot
- login with root user
- ifconfig
- ping www.sapo.pt
- apt-get update
- python -V # version 2.7.3
dpkg -l > /tmp/initialPackages.txt
Installation Debian 7.5.0 amd64
Fetch and burn the ISO
wget http://cdimage.debian.org/debian-cd/7.5.0/amd64/iso-dvd/debian-7.5.0-amd64-DVD-1.iso
- modprobe sg # fpr cdrecord
- cdrecord -scanbus #identify the device
- cdrecord -dev=1,0,0 -pad -data debian-7.5.0-amd64-DVD-1.iso
- # eject the DVD after burning
- cd /
- mount /dev/sr0 /mnt/cdrom #check DVD
- cd /mnt/cdrom
- ls
- cd /
- umount /mnt/cdrom
Install
- Boot the machine
- Insert DVD
- select install
- language: english
- country, other, Europe, Portugal
- default locale, United States
- keymap: portuguese
- load missing firmware from removable media? no
- hostname for system: debianWheezy
- domain name: bitarus.allowed.org
- root pass: ........
- full name new user: vitor
- username: vitor
- pass: ........
- location: Lisbon
- Partition disks, use entire disk and use LVM
- SCSI1
- separate /home, /usr , /var, /tmp
- write changes to disk and configure LVM: yes
- Finish partitioning and write changes to disk
- Write changes to disk? yes
- install base system
- kernel: linux-image-amd64
- Drivers to include in initrd: generic
- scan another CD/DVD? no
- use network mirror: yes
- Debian archive mirror country: Portugal
- ftp.pt.debian.org
HTTP proxy: <blank>
- Participate in the package usage survey: No
- select standard utilities
- install GRUB to the MBR? yes
- reboot
Install extra packages
- #login as root
- df -h # check disk usage
- ifconfig # check network devices
- ping www.sapo.pt
- vi /etc/apt/sources.list # comment the line with deb cdrom
- apt-get install lynx
- apt-get install links
- apt-get install xorg
- apt-get install wmaker
- startx #starts X if all goes well
- xterm #open a console
- apt-get install iceweasel
iceweasel & #run firefox with branding
- apt-get install kdm
- vi /etc/inittab
- #change default runlevel to 5
- #id:5:initdefault
- #add line to runlevel 5
- #x:5:respawn:/usr/bin/X
- reboot # after the reboot should appear the KDM login window
- #login
- xterm
- apt-get install vim
- apt-get install icedove
- apt-get install wmclockmon
On WindowMaker Clip click with right mouse button and select Attract Icons
- On each attracted icon select Keep Icon
- apt-get install pidgin
- apt-get install emacs
- apt-get install netbeans
- apt-get install mongodb
- apt-get install monodevelop
- apt-get install mono-complete
- apt-get install samba
- apt-get install cifs-utils
Eclipse
- apt-get install eclipse #eclipse 3.8
eclipse &
- create workspace in ~/workspace
Two monitors with digital output
- xrandr #show the current outputs and definitions for X
- vi /etc/kde4/kdm/Xsetup
- xrandr --output DP-2 --right-of DP-1 # two monitors
- setxkbmap pt # portuguese keyboard
Enable multiarch and install Skype
- dpkg --add-architecture i386
- apt-get update
wget -O skype-install.deb http://www.skype.com/go/getskype-linux.deb
- dpkg -i skype-install.deb
- apt-get -f install
- dkpg -i skype-install.deb
Resize /home folder
- df -h #check sizes
- umount /home
- e2fsck -f /dev/mapper/debianWheezy-home
- resizefs /dev/mapper/debianWheezy-home 200G
- lvreduce -L 200G /dev/mapper/debianWheezy-home
- mount /dev/mapper/debianWheezy-home
- vgdisplay
Debian 8.6.0
VMDebian Linux Debian 64 bit 4096MB VDI type dynamic allocation 16 GB create debian-8.6.0-amd64-DVD-1.iso install english location other europe Portugal default local en_us.UTF8 keyboard portuguese hostname debian domain name <empty> root pass new user vitor clock Lisbon Partition, guided user entire disk LVM scsi(0,0,0) sda all in one partition write change yes Finish partitioning scan other cd dvd no use net mirrors yes portugal ftp.pt.debian.org package survey no software to install desktop kde lxde ssh web server print server standard utils displaymanager kdm install grub in MBR yes /dev/sda Finish installation continue VBoxManage setextradata "VMDebian" "CustomVideoMode1" "1366x768x32" Use 2 cpu cores in the VM run guest additions /etc/apt/sources.list # sid deb http://ftp.pt.debian.org/debian/ sid main contrib deb-src http://ftp.pt.debian.org/debian/ sid main contrib apt-get update
Install debian 10 - buster on external HDD with USB adapter
- dd if=debian-live-10.1.0-amd64-standard.iso of=/dev/sda bs=512k # write ISO file to USB pen drive (8GB)
- boot the pen with UEFI support (Esc and F9 to access Boot menu on HP)
- after boot change the layout to pt in the file /etc/default/keyboard and then run setupcon
- Boot the pen again and choose Debian installer (console)
- Select portuguese language and configure the locale accordingly
- Use guided partinioning, whole disk, scsi5 , sdc with 500 GB
- 3 partitions were created, ESP, root / with ext4 and a swap partition
- Don't use network mirrors
- Define root password and add a user
- Go through all the steps and reboot
- Use the pen again to configure extra EFI definitions inside the ESP partition
- Mount the ESP partition and inside the EFI folder create the BOOT folder
- copy all files inside the debian folder to the BOOT folder
- Go to the BOOT folder and copy the shimx64.efi to BOOTx64.efi
- Boot using the HDD disk
- If an error appears saying "/dev/sdX doesn't exist" with means grub didn't write the right HDD device name. It's required to acces grub options before boot and change the device name
- After a proper boot is made into the HDD we need to run the command update-grub to update the grub with the right device name
- To use WiFI we need the firmware-iwlwifi_20190114-2_all.deb to be installed, download it
- Install using dpkg -i firmware-iwlwifi_20190114-2_all.deb
- The WiFI device detected is wlp2s0
- ip a; iwconfig; ip link set wlp2s0 up; iwlist scan
- An conf file in /etc/wpa_supplicant/wpa_supplicant.conf is required
ap_scan=1 ctrl_interface=/var/run/wpa_supplicant network={ ssid="?????????" scan_ssid=1 proto=RSN WPA key_mgmt=WPA-PSK group=CCMP TKIP pairwise=CCMP TKIP psk="???????" }
- Run command wpa_supplicant -B -c/etc/wpa_supplicant/wpa_supplicant.conf -i wlp2s0
- Update the file /etc/apt/sources.list and comment cdrom entry
deb http://ftp.pt.debian.org/debian/ buster main contrib non-free deb-src http://ftp.pt.debian.org/debian/ buster main contrib non-free
- apt update
- apt install xorg wmaker xterm lightdm firefox-esr alsa-tools alsa-tools-gui alsa-utils alsa-oss alsamixergui libalsaplayer0 htop wmclockmon vim openjdk-11-jdk docker.io
/sbin/usermod -a <user> -G docker
- Test X using startx command
- service lightdm start
- Inside /etc/lightdm/lightdm.conf in [Seat:*] add display-setup-script=setxkbmap pt
- To control the sound use the alsamixer command. The m key mutes and unmutes the master sound control
- end the current session and start a new one to be able to use docker (docker ps)
cd /boot/efi/EFI/ mv BOOT BOOT_bak cp -R debian BOOT cd BOOT mv shimx64.efi bootx64.efi
- Configure keyboard after login with ibus-setup.
Debian buster in VirtualBox VM
- 4GB RAM, 1 CPU, 16GB disk
get https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/debian-live-10.1.0-amd64-standard.iso run virtualbox new vm name Debian buster type linux, version debian 64 bit ram 4096 GB create virtual vdi 16GB dynamically allocated settings storage, ide, choose virtual optical drive, attach iso debian-live-10.1.0-amd64-standard.iso to VM start VM choose debian installer language: english country other, europe, portugal, default locale en_us keyboard portuguese hostname debian domain name "" root pass: new user: vitor username: vitor pwd: configure clock: Lisbon partition disks: guided - use entire disk and set up LVM use scsi3, sda all files in one partition write changes and configure lvm: yes volume group to use for guided partition: 16.9 GB write changes to disk: yes use network mirror: yes, portugal, deb.debian.org proxy info: blank install grub2 in MBR: yes install in /dev/sda install complete, continue reboot choose debian gnu/linux login with root:toor apt update apt install xorg wmaker xterm lightdm firefox-esr htop wmclockmon vim docker.io /sbin/usermod -a vitor -G docker service lightdm start Inside /etc/lightdm/lightdm.conf in [Seat:*] add display-setup-script=setxkbmap pt add greeter-setup-script=setxkbmap pt add session-setup-script=setxkbmap pt [LightDM] add display-setup-script=setxkbmap pt add greeter-setup-script=setxkbmap pt add session-setup-script=setxkbmap pt In ~/.xsessionrc add /usr/bin/setxkbmap pt & /usr/bin/xterm & Devices, insert guest additions cd image mount /dev/cdrom /mnt cd /mnt ./VBoxLinuxAdditions.run # window maker workspace, appearance, background, styles, green workspace, appearance, background, solid, black workspace, appearance, save theme, MyTheme https://wiki.debian.org/Keyboard#How_to_switch_a_keyboard_layout_in_X11_.2F_graphical_desktop_environment The keyboard setup dialog in GNOME 3 will modify IBus's configuration directly, but for users of other X environments, you can use the ibus-setup command to modify the settings for IBus. To force it to defer to the settings from /etc/default/keyboard, run ibus-setup, go to the Advanced tab, and check Use system keyboard layout. ibus-setup input method add portuguese cd C:\Program Files\Oracle\VirtualBox VBoxManage setextradata "Debian buster" "CustomVideoMode1" "1366x768x32" xrandr --output Virtual1 --mode 1360x768 vitor@debian:~$ cat .xsessionrc /usr/bin/setxkbmap pt& /usr/bin/xterm & xrandr --output Virtual1 --mode 1360x768 & #### get jdk8 from https://adoptopenjdk.net/ apt install net-tools openssh-server ntp ntpsec-ntpdate add host port 2222 to vm guest port 22 /sbin/usermod -a vitor -G vboxfs # shared folder virtualbox wget https://archive.eclipse.org/technology/epp/downloads/release/luna/SR2/eclipse-java-luna-SR2-linux-gtk-x86_64.tar.gz cd /opt tar xvzf eclipse-java-luna-SR2-linux-gtk-x86_64.tar.gz chgrp users eclipse/ chgrp users eclipse/* -R /opt/eclipse/eclipse.ini -startup plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar --launcher.library plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20150204-1316 -product org.eclipse.epp.package.java.product --launcher.defaultAction openFile -showsplash org.eclipse.platform --launcher.XXMaxPermSize 256m --launcher.defaultAction openFile --launcher.appendVmargs -vm /opt/jdk8u222-b10/bin/java -vmargs -Dosgi.requiredJavaVersion=1.6 -XX:MaxPermSize=256m -Xms40m -Xmx512m run_eclipse.sh /opt/eclipse/eclipse apt install thunar mousepad wmmon xrandr --output Virtual1 --mode 1366x768 mousepad oblivion theme monospace regular 12 cat lightdm.conf | grep -v "^#" /etc/lightdm/lightdm.conf [LightDM] display-setup-script = setxkbmap pt greeter-setup-script = setxknmap pt session-setup-script = setxkbmap pt [Seat:*] [XDMCPServer] [VNCServer] #### apt install xfce4-terminal apt install wmmon apt install wmix apt install mono apt install python-pip apt install cowsay apt install unzip apt install libxml2-utils apt install gimp apt install xmlsec1 xrandr --output Virtual1 --mode 1366x768 apt install curl zip unzip /sbin/dhclient enp0s3 # install openjdk 11 cd ~ wget https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz tar xvzf openjdk-11.0.2_linux-x64_bin.tar.gz # add ~/jdk-11.0.2/bin to ~/.bashrc # get eclipse with open jdk 11 support cd ~ wget http://mirror.dkm.cz/eclipse/technology/epp/downloads/release/2019-09/R/eclipse-java-2019-09-R-linux-gtk-x86_64.tar.gz tar xvzf eclipse-java-2019-09-R-linux-gtk-x86_64.tar.gz # copy paste In virtualbox choose general, advanced, shared clipboard, bidirectional
Add LVM disk debian buster
- Virtualbox
- Settings VM, storage, controller sata, add hard disk, create new disk, vdi, next, fixed size, 8GB, create
1 fdisk /dev/sdb # n, partition , 2st sector 2048, last sector 16777215, w
2 pvcreate /dev/sdb1 # pvcreate - initialize a disk or partition for use by LVM
3 vgdisplay # vgdisplay - display attributes of volume groups
4 pvscan # pvscan - scan all disks for physical volumes
5 vgextend debian-vg /dev/sdb1 # vgextend - add physical volumes to a volume group
6 pvscan # pvscan - scan all disks for physical volumes
7 lvdisplay # lvdisplay - display attributes of a logical volume
8 lvextend /dev/debian-vg/root /dev/sdb1 # lvextend - extend the size of a logical volume
9 vgdisplay # vgdisplay - display attributes of volume groups
10 resize2fs /dev/debian-vg/root # resize2fs - ext2/ext3/ext4 file system resizer
11 # other disk
12 fdisk -l
13 fdisk /dev/sdc
14 pvcreate /dev/sdc1
15 vgextend debian-vg /dev/sdc1
16 lvextend /dev/debian-vg/root /dev/sdc1
17 resize2fs /dev/debian-vg/root
18 df -h
19 # other disk /dev/sdd 8 GB
20 fdisk /dev/sdd
21 pvcreate /dev/sdd1
22 vgextend debian-vg /dev/sdd1
23 lvextend /dev/debian-vg/root /dev/sdd1
24 resize2fs /dev/debian-vg/root
25 df -h
26 # other disk /dev/sde 8GB
27 fdisk -l
28 fdisk /dev/sde # n, partition , 2st sector 2048, last sector 16777215, w
29 pvcreate /dev/sde1
30 vgextend debian-vg /dev/sde1
31 lvextend /dev/debian-vg/root /dev/sde1
32 resize2fs /dev/debian-vg/root
33 df -h
34
35 # other disk /dev/sdf 8GB
36 fdisk -l
37 fdisk /dev/sdf # n, partition , 2st sector 2048, last sector 16777215, w
38 pvcreate /dev/sdf1
39 vgextend debian-vg /dev/sdf1
40 lvextend /dev/debian-vg/root /dev/sdf1
41 resize2fs /dev/debian-vg/root
42 df -h
Alsa and Pulseaudio
apt purge pulseaudio pulseaudio-utils xfce4-pulseaudio-plugin pavumeter pavucontrol apt install alsa-tools alsa-tools-gui alsa-utils alsa-oss alsamixergui libalsaplayer0 /sbin/alsactl init aplay /usr/share/sounds/alsa/Noise.wav
Sandbox
Settings, shared folders, Machine folders, Name: sandbox Path: c:\users\userx\sandbox Access: Full Automount: yes At:/sandbox
- /sbin/usermod -a userx -G vboxsf
- ln -s /sandbox/ sandbox
Skype for Linux (deb)
- apt --fix-broken install
- dpkg -i skypeforlinux-64.deb # debian buster
Restart clipboard copy paste in VirtualBox VM