User Tools

Site Tools


linux

APACHE

Linux

http://rohankapoor.com/2012/04/americanizing-the-raspberry-pi/

sudo pcmanfm

moving a folder

mv /etc/freedns/ /home/pi/freedns

Find

find . -name testfile.txt

Apache

permissions

where: X is any combination of the letters `u' (for owner), `g' (for group), `o' (for others), `a' (for all; that is, for `ugo'); @ is either `+' to add permissions, `-' to remove permissions, or `=' to assign permissions absolutely; and Y is any combination of `r', `w', `x'. Following are some examples:

  • chmod u=rx file (Give the owner rx permissions, not w)
  • chmod go-rwx file (Deny rwx permission for group, others)
  • chmod g+w file (Give write permission to the group)
  • chmod a+x file1 file2 (Give execute permission to everybody)
  • chmod g+rx,o+x file (OK to combine like this with a comma)

CRON

crontab -e

from the webcam thing

https://www.raspberrypi.org/documentation/usage/webcams/

crontab -e

crontab -u userName -l crontab -u vivek -l

0 * * * * /path/to/script.ksh

# Example of job definition:$
# .---------------- minute (0 - 59)$
# | .------------- hour (0 - 23)$
# | | .---------- day of month (1 - 31)$
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...$
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat$
# | | | | |$
# * * * * * user-name command to be executed$

By default the first column is for minutes and the second one is for hour

every 30 minutes is

*/30 * * * * /path/program.sh

DNS update script

dns script

I did one of the maybe 10 years ago and managed it then. But I have forgotten sooo much. This time I hacked together from two sources that was actually similar in concept to what I once did. What I finished with

dnsactual.sh

BUT you have to install dnsutils package, otherwise dnslookup will not work

sudo apt-get install dnsutils

Other commands

  • (a) df command : Report file system disk space usage.
  • (b) du command : Estimate file space usage. df command examples – to check free disk space

Type df -h or df -k to list free disk space: $ df -h

OR $ df -k

Mount Drive at Boot

This is what I used to mount the USB stick on the Raspberry Pi

Use this to figure out the UUID of the usb stick

sudo blkid

then edit the fstab to mount it

sudo nano /etc/fstab

proc            /proc           proc    defaults          0       0
/dev/mmcblk0p6  /boot           vfat    defaults          0       2
/dev/mmcblk0p7  /               ext4    defaults,noatime  0       1
UUID=42981DB8981DAC03 /mnt/plexlib ntfs defaults 0 0

Drive Space

https://raspberrypi.stackexchange.com/questions/7500/how-to-get-a-good-overview-over-used-space

  • du -s * | sort -nr | head
  • du -m | sort -n

Mount Other Drive

https://linuxconfig.org/how-to-move-var-directory-to-another-partition

http://blog.oshim.net/2011/10/how-to-move-var-folder-to-new-partition.html

https://askubuntu.com/questions/125257/how-do-i-add-an-additional-hard-drive

Well I tried moving var folder to new partition and edited fstab to say this

/dev/sda3	/var		ext4    defaults	  0       0

But but I couldn't boot and ended up just starting from scratch and installed the non NOOBS version.

BUT, while getting out of the shower this morning I remembered that I forgot to make an empty new VAR folder for the new partition to be mounted into…Dang if it actually worked! it took a few reboots for the OS to adjust the file structure but on the third boot it all worked.

Still I went back to my new install, but it is good to know it works

linux.txt · Last modified: 2019/03/08 09:22 by zeppo