Linux Mint 13
- Restart X-Server: CTRL+ATL+BACKSPACE
- EVGA NVidia Geforce GT 240
- XWindows freezes using the Live CD because of the video card.
- When booting up the Live CD, select the 1st menu option and press Tab.
- User cursor keys to get before "quiet splash".
- Add text NOMODESET.
- XWindows will work, but in reduced mode, so the menu button in the bottom left isn't as fully functioning.
- Need to enable the NVidia private drivers to get the full experience.
- Menu -> Preferences -> Software Sources
- Tab: Additional Drivers
- XWindows freezes using the Live CD because of the video card.
- GRUB 1.99
- Sector 32 is already in use by FlexNet
- Backup of the first 63 sectorsCopy to clipboardsudo dd if=/dev/sda of=~/first_63_sectors bs=512 count=63
- erase Sector 1 through Sector 62Copy to clipboardsudo dd if=/dev/zero of=/dev/sda bs=512 count=62 seek=1
- Source: http://ubuntuforums.org/showthread.php?t=1661254
- Backup of the first 63 sectors
- Sector 32 is already in use by FlexNet
- Disk Utility
- Error doing BLKPG ioctl with BLKPG_ADD_PARTITION for partition 1 of size 32256 at offset 233178430464 on /dev/sda: Device or resource busy
- This seems to be from Disk Utility. I partitioned with GParted and everything ran smoothly.
- Nautilus
- Breadcrumbs
- Changing this setting through gconf-editor does not take effect, but changing through the command line does, though both are the same setting.
- GUI:
- Applications > System Tools > Configuration Editor (or Alt+F2 and enter gconf-editor) then go to apps/nautilus/preferences and tick the box that says always_use_location_entry.
- reference: http://community.linuxmint.com/tutorial/view/562
- Command line:
- Copy to clipboard$ gsettings set org.gnome.nautilus.preferences always-use-location-entry true
- reference: http://forum.linuxmint.com/viewtopic.php?f=206&t=102465
- Breadcrumbs
- Install a library
- usually you add "-dev" to the library name and do an apt-get
- For libusb library do $ sudo apt-get install libusb-dev
- usually you add "-dev" to the library name and do an apt-get
- Notifications
- Make a notificationCopy to clipboardnotify-send --icon=gtk-add "Test notification" "This is the message body"
- Changing notification placement: http://www.ubuntugeek.com/how-to-install-oracle-java-7-in-ubuntu-12-04.html
- Make a notification
- Dropbox
- Get from dropbox's website instead of the Software Manager package
- After the .deb installs, run Menu -> Internet -> Dropbox to finish downloading package
- After this, it will start the daemon
SSH Server
- Install:Copy to clipboardapt-get install openssh-server
- Settings file: /etc/ssh/sshd_config
- Restart
- older:
- Copy to clipboard/etc/init.d/ssh restart
- newer:
- Copy to clipboardsudo service ssh restart
- older:
- Check if SSH service is running
- Copy to clipboardsudo systemctl status ssh
- Securing SSH With Iptables
- Copy to clipboard$ sudo iptables -A INPUT -p tcp -m tcp --dport 22 -m state --state NEW -m recent --set --name DEFAULT --rsource $ sudo iptables -N LOG_AND_DROP $ sudo iptables -A INPUT -p tcp -m tcp --dport 22 -m state --state NEW -m recent --update --seconds 60 --hitcount 4 --name DEFAULT --rsource -j LOG_AND_DROP $ sudo iptables -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT $ sudo iptables -A LOG_AND_DROP -j LOG --log-prefix "iptables deny: " --log-level 7 $ sudo iptables -A LOG_AND_DROP -j DROP $ sudo aptitude install iptables-persistent
- Create file: /etc/rsyslog.d/iptables.conf
- Copy to clipboard:msg,contains,"iptables deny: " /var/log/iptables.log & ~
- Create file: /etc/logrotate.d/iptables
- Copy to clipboard/var/log/iptables.log { rotate 7 daily missingok notifempty delaycompress compress postrotate invoke-rc.d rsyslog reload > /dev/null endscript }
- http://blog.bigdinosaur.org/securing-ssh-with-iptables/
- https://linuxize.com/post/how-to-enable-ssh-on-ubuntu-20-04/
Apache
- Restart:Copy to clipboardsudo /etc/init.d/apache2 restart
Google Chrome
- Copy to clipboardwget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - echo deb http://dl.google.com/linux/chrome/deb/ stable main | sudo tee -a /etc/apt/sources.list.d/google.list sudo apt-get update && sudo apt-get install google-chrome-stable
PhpMyAdmin
- Using the software installation, the configuration might not be done:
- If /var/www/phpmysqladmin/ does not exist, then it did not run through setup
- Run setup with:Copy to clipboard$ sudo dpkg-reconfigure -plow phpmyadmin
- Directory location:
- Apache config is /etc/apache2/apache2.conf has "Include conf.d/"
- conf.d/ has phpmyadmin.conf that gets included
- phpmyadmin.conf has "Alias /phpmyadmin /xxxx" which is location of website files
- If PhpMyAdmin gives error: Login without a password is forbidden by configuration (see AllowNoPassword)
- Best to change root password
- Can also set phpMyAdmin to allow accounts without a password:
- edit: /etc/phpmyadmin/config.inc.php
- Uncoment line: $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
find
- the errors for "Permission denied" are output to the error console, not the regular console, so you get rid of them using error redirection, not grep
- Copy to clipboard$ find / -name passwords.txt 2>/dev/null
- Gimp
- Manually update to Gimp 2.8 from Gimp 2.6 in repo
- Copy to clipboardsudo apt-get purge gimp* sudo add-apt-repository ppa:otto-kesselgulasch/gimp sudo apt-get update sudo apt-get install gimp
- source: http://www.faqforge.com/linux/install-gimp-2-8-on-ubuntu-12-04-and-mint-13/
- Manually update to Gimp 2.8 from Gimp 2.6 in repo
Java
- Remove OpenJDK
- Copy to clipboardsudo apt-get purge openjdk*
- Install Oracle JDK
- Copy to clipboardsudo add-apt-repository ppa:webupd8team/java sudo apt-get update && sudo apt-get install oracle-java7-installer
Screenshots
- if Print Screen button doesn't work:
- Copy to clipboardimport -window root filename.ext
- To add a delay:Copy to clipboardsleep 3s; import -window root screenshot.png
- Gimp->File->Create->Screenshot
Make Linux use local time instead of UTC
- edit /etc/default/rcS
- Set UTC=yes if your hardware clock is set to UTC (GMT), or UTC=no to have the hardware clock set to local time.
Show All Running Processes in Linux
- ps, top, pstree, pgrep, atop, htop
- http://www.cyberciti.biz/faq/show-all-running-processes-in-linux/
Clonezilla
- Restoring partition image to a different partition
- The original partition device name is saved with the image files:
- The partition name is stored in the file: [partition folder]/part
- The partition name is part of the file name for all the image files
- Just change the name of the partition in the file [partition folder]/part
- Rename all the image files with the new partition name
- I saved the partition from /dev/sda6, and needed to restore it to /dev/sda9
- Old [partition folder]/part:
- Copy to clipboard$ cat part sda6
- New [partition folder]/part:
- Copy to clipboard$ cat part sda9
- Old file names:
- Copy to clipboard$ ls sda6* sda6..aa sda6..ab sda6..ac
- New file names:
- Copy to clipboard$ ls sda9* sda9..aa sda9..ab sda9..ac
- I used vi to edit [partition folder]/part
- I used nano to write a bash script:
- Copy to clipboardfor $item in sda6* do item2=${$item/sda6/sda9} mv $item $item2 done
- Old [partition folder]/part:
- The original partition device name is saved with the image files:
NginX
- How to set up a safe and secure Web server
- http://arstechnica.com/gadgets/2012/11/how-to-set-up-a-safe-and-secure-web-server/
Pogoplug Arch Linux for ARM
- check file system
- umount the drive and run e2fschk -y -f /dev/sdxn (sdxn will probably be sdb1)
- Install on POGO-E02 and POGO-E02G (Pink model)
- http://archlinuxarm.org/platforms/armv5/pogoplug-v2-pinkgray
- The boot loaders are in NAND
- To recover from power outage:
- format & extract the latest rootfs tarball, as root (not! sudo, but sudo su if necessary), onto your USB drive
- Label partition "rootfs"Copy to clipboard'tune2fs -L "rootfs" /dev/sdX#
VirtualBox
- Extension Pack
- You have to download the Extension Pack from the VirtualBox website manually
- There isn't a package for this
- Guest Additions
- The .iso file to run inside the virtual machine
- There is a linux package for this
- Shared Folders
- Machine (permanent) shared folders that exist before the machine is started
- Mounted in /media/sf_NAME
- Folder name is prepended by sf_
- Owner is root, Group is vboxsf
- Transient shared folders, and machine shared folders created while the machine is running
- Need to mount with: mount -t vboxsf -o uid=XXX SHARE MOUNTPOINT
- Using gid option didn't work for me
- You can mount them anywhere
- Name is as is
- Without the -o option, owner is root, group is root, and can't be changed with chown or chmod
- Use linux command id to find out id numbers for users
- Machine (permanent) shared folders that exist before the machine is started
Samba
- Installing Samba
- http://www.jeremymorgan.com/tutorials/raspberry-pi/how-to-raspberry-pi-file-server/
Wake On Lan (WOL)
Sending WOL packet
etherwake
- Install
- Copy to clipboardsudo apt install etherwake
- Run
- Copy to clipboardsudo etherwake -i eth0 ab:cd:ef:gk:hi:jk
- https://www.instructables.com/Raspberry-Pi-As-Wake-on-LAN-Server/
- Bottom half of https://engineerworkshop.com/blog/remote-start-for-servers-how-to-set-up-wake-on-lan/
Receiving WOL packet
ethtool
- Find specific network adapter
- Copy to clipboardifconfig
- If ifconfig is not installed, install with:
- Copy to clipboardsudo apt install net-tools
- Check to see if wake-on-LAN is available on your NIC with ethtool
- Copy to clipboardsudo ethtool eth0
- Look for this line, and the letter "g" to know your card supports WOL
- If not there, might just need to turn on in BIOS
- Copy to clipboardSupports Wake-on: pumbg
- Enable the system for Wake-On-LAN
- Copy to clipboardsudo ethtool -s eth0 wol g
- Need to enable it at every boot
- Ubuntu:
- Create a system service
- Copy to clipboardsudo nano /etc/systemd/system/wakeOnLAN.service
- File contents:
- Copy to clipboard[Unit] Description=Re-enable WOL [Service] Type=oneshot ExecStart=/sbin/ethtool -s eth0 wol g [Install] WantedBy=basic.target
- Enable the service
- Copy to clipboardsudo systemctl enable wakeOnLAN.service
- Create a system service
- Ubuntu:
Network Scan
nmap
- Install
- Copy to clipboardsudo apt-get install nmap
- Run
- Copy to clipboardsudo nmap -sP 192.168.0.0/24 | awk '/Nmap scan report for/{printf $5;}/MAC Address:/{print " "$3;}'
Disk Free Space
df (command line)
- df = "disk-free," available and used disk space
- df -h = human readable format
Disks (GNOME GUI)
- gnome-disk-utility
du (command line)
- du = disk usage of files, folders
- du -h = human readable format
- du -s = total disk space of a particular file or directory
Disk Usage (GNOME GUI)
- Disk Usage application
- https://opensource.com/article/18/7/how-check-free-disk-space-linux
Xubuntu
VNC Gray Screen
- Change ~/.xstartup
- Copy to clipboard#!/bin/sh unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS startxfce4 &
- https://askubuntu.com/questions/1068370/vnc-grey-screen-ubuntu-16-04-tightvnc-xfce4
Login screen loop
- Keeps going back to login screen after logging in
- At login screen, drop to console with CTRL+ALT+F3
- login
- check if .Xauthority is properly assigned to you
- Copy to clipboardls -lah | grep -i Xauthority
- if assigned to root, that is the problem
- Copy to clipboardsudo chown username:username .Xauthority
- go back to login gui with CTRL+ALT+F7
- https://www.maketecheasier.com/fix-ubuntu-login-loop/
VNC
Error "timeout in locking authority file .Xauthority"
- The lock files ~/.Xauthority-c and ~/.Xauthority-l are leftover from a previous session
- Copy to clipboardrm -fr .Xauthority-*
- https://unix.stackexchange.com/a/215559
Error "exit status 217"
- "vncserver@1.service: Control process exited, code=exited, status=217/USER"
- Need to correct the user name in the file: /etc/systemd/system/vncserver@.service
- https://www.digitalocean.com/community/questions/couldn-t-start-vnc-server
Error "no matching security types"
- There isn't a standard for encryption. RealVNC has proprietary encryption from the server. Opensource projects don't have that.
- Either use RealVNC Viewer, or turn off the encryption:
- Edit file:
- Copy to clipboard/root/.vnc/config.d/vncserver-x11
- Copy to clipboardAuthentication=VncAuth Encryption=AlwaysOff Password=e0fd0472492935da
- Then reset the password:
- Copy to clipboardsudo vncpasswd -service
- When using the RealVNC client, you will get the warning that the connection is not secure.
- https://superuser.com/questions/1194583/tigervnc-viewer-no-matching-security-types
Install VNC
- Copy to clipboardsudo apt install xfce4 xfce4-goodies tightvncserver
- Copy to clipboardnano ~/.vnc/xstartup
- Copy to clipboard#!/bin/bash xrdb $HOME/.Xresources startxfce4 &
- https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-16-04
SSH to VNC
- Copy to clipboardssh -L 5901:127.0.0.1:5901 -N -f -l username server_ip_address
- If you are using a graphical SSH client, like PuTTY, use server_ip_address as the connection IP, and set localhost:5901 as a new forwarded port in the program’s SSH tunnel settings.
- use a VNC client to attempt a connection to the VNC server at localhost:5901
- https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-16-04
APT
Alternatives
Nala
- https://gitlab.com/volian/nala
- https://www.youtube.com/watch?v=oroSkR4Nn_w
Ubuntu
Lid Close Behavior
- How to Change Lid Close Behavior in Ubuntu 20.04, 22.04 & 23.10 Updated
- How can I tell Ubuntu to only turn the screen off when I close my laptop lid?
- How can I tell Ubuntu to do nothing when I close my laptop lid?