Internet Speed Test with CLI
- sudo apt-get install python-pip
- sudo easy_install speedtest-cli
- Execute "speedtest-cli"
https://raspberrypi.stackexchange.com/questions/32252/how-do-i-do-an-internet-speedtest-from-cli-on-raspbian
SpeedTest - more accurate
sudo apt-get install git
sudo apt-get install build-essential libcurl4-openssl-dev libxml2-dev
libssl-dev cmake
git clone https://github.com/taganaka/SpeedTest
cd SpeedTest/
cmake -DCMAKE_BUILD_TYPE=Release .
sudo make install
Disable/Enable Services at Boot time
Example:
sudo
update-rc.d minidlna defaults
This
should add the service to the automatic startup system. But if you get:
System
start/stop links for /etc/init.d/minidlna already exist.
Do
the command
sudo
update-rc.d minidlna enable
https://askubuntu.com/questions/9382/how-can-i-configure-a-service-to-run-at-startup
Gnome hangs with ldap
authentication
/etc/pam.d/gdm
auth sufficient pam_ldap.so
account
sufficient pam_ldap.so
password sufficient pam_ldap.so
https://www.linuxquestions.org/questions/fedora-35/gnome-hangs-with-ldap-authentication-719558/
Mount Drives with Current User (easier)
sudo mount -t cifs //crh16vadvinstal/richware ./VisualStudio -o username=$USER,uid=`id | sed -e 's/.*uid=//' -e 's/(.*$//'`,gid=254000513,rw
PHP Settings - Force Update
If php settings do not take
(get the path)
php -i|grep php.ini
sudo service httpd reload
Redirecting to /bin/systemctl reload httpd.service
sudo service php-fpm restart
Redirecting to /bin/systemctl restart php-fpm.service
Clean out system journal (linux)
journalctl --vacuum-size=500M
You can set this in /etc/systemd/journald.conf like so:
SystemMaxUse=100M
This will be enforced on the next reboot or restart of the journald
service:
$ systemctl restart systemd-journald
https://unix.stackexchange.com/questions/139513/how-to-clear-journalctl
Increase drive space in CentOS (or "Linux LVM"
volumes)
New instructions
--------------------------------------------------
# Install growpart
yum install cloud-utils-growpart -y
# Increase the drive space in VMware or VBox
# (For Linux LVM volumes)
# See the space is not there yet
df -h
# Get and note the Volume Group
vgs
# Get the last partition number. This is what will grow
# Starting from 1, count all "part" in the "TYPE" colum
# Note that number down
sudo lsblk
# Grow the partition using the number from lsblk
# This example is using drive /dev/sda and partition 4
sudo growpart /dev/sda 4
# Resize the Volume Group partition. It will match the
# last part that you counted in lsblk
pvresize /dev/sda4
# Extend the Volume Group to max out the size
# My Volume Group name is "cs", so this example is:
sudo lvextend -l +100%FREE /dev/mapper/cs-root
# Now grow the partition to [all] the available space
# on the Volume Group
sudo xfs_grow -d /dev/mapper/cs-root
# Verify that the drive space is increased
df -h
Add disk space to any Linux drive Online
Rescan volume
#install growpart if it's not already installed
sudo apt-get install cloud-guest-utils
su
(must be root to do an online disk rescan)
echo 1 > /sys/block/sdX/device/rescan (where X = your disk. Use sudo fdisk -l to get)
/sbin/resize2fs /dev/sd#
^D #to quit su
#should now show the updated drive space
df -h
https://codenotary.com/blog/enlarge-a-disk-and-partition-of-any-linux-vm-without-a-reboot
Rescan all drives. Does not require reboot
for host in /sys/class/scsi_host/*; do echo "- - -" | sudo tee $host/scan; ls /dev/sd* ; done
Delete Files Older Than x Days on Linux
https://www.howtogeek.com/howto/ubuntu/delete-files-older-than-x-days-on-linux/
Lowell Heddings
Updated Feb 1, 2017, 10:04 pm EDT | 1 min read
The find utility on linux allows you to pass in a bunch of interesting arguments, including one to execute another command on each file. We’ll use this in order to figure out what files are older than a certain number of days, and then use the rm command to delete them.
Command Syntax
find /path/to/files* -mtime +5 -exec rm {} \;
Note that there are spaces between rm, {}, and \;
Explanation
The first argument is the path to the files. This can be a path, a directory, or a wildcard as in the example above. I would recommend using the full path, and make sure that you run the command without the exec rm to make sure you are getting the right results.
The second argument, -mtime, is used to specify the number of days old that the file is. If you enter +5, it will find files older than 5 days.
The third argument, -exec, allows you to pass in a command such as rm. The {} \; at the end is required to end the command.
VirtualBox (vbox) List Running VMs from console
#!/bin/bash
vboxmanage list runningvms | while read line; do
#echo "VBoxManage controlvm $uuid savestate;"
echo $line
if [[ $line =~ \{(.*)\} ]]
then
vboxmanage controlvm ${BASH_REMATCH[1]} savestate
fi
done
Code to help out links to folders
In Apache/httpd
<Directory "/var/www">
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/insider.crouse.org>
AllowOverride All
Options Indexes FollowSymLinks
</Directory>
.nanorc Nano
#set mouse
set linenumbers
set smarthome
set smooth
set trimblanks
mp3wrap - combining mp3 files
mp3wrap so that you can put them in order
https://askubuntu.com/questions/20507/concatenating-several-mp3-files-into-one-mp3
find . -maxdepth 1 -iname '*.mp3' -print0 | sort -z | xargs -0 mp3wrap ~/output.mp3
.