Saturday, March 10, 2018

Delete Windows files from old drive (Windows 10)

Windows 10

takeown /F "D:\Program Files.old\" /A /R /D Y
cacls "D:\Program Files.old\*.*" /T /grant administrators:F
rmdir /s /q "D:\Program Files.old\"

Wednesday, December 6, 2017

Change filename to lowercase



root@localhost# rename 'y/A-Z/a-z/' *


Monday, November 13, 2017

Find and delete files


Find par2 files starting from current dir, and print the results of the find
find . -type f -name "*.par2" -print


Find par2 files starting from current dir, and forcibly remove (rm -f)
find . -type f -name "*.par2" -exec rm -f {} \;


Wednesday, November 1, 2017

vsftpd default file permissions (default umask)

For default permissions of 644

local_enable=YES
write_enable=YES
local_umask=0022
file_open_mode=0777

anonymous_enable=NO
anon_upload_enable=YES
anon_mkdir_write_enable=YES



From http://wintelguy.com/umask-calc.pl 

File Mode Creation Mask / umask Calculator

MaskFiles
(requested permissions 666)
Directories
(requested permissions 777)
000666 (rw-rw-rw-)777 (rwxrwxrwx)
002664 (rw-rw-r--)775 (rwxrwxr-x)
007660 (rw-rw----)770 (rwxrwx---)
022644 (rw-r--r--)755 (rwxr-xr-x)
027640 (rw-r-----)750 (rwxr-x---)
077600 (rw-------)700 (rwx------)
277400 (r--------)500 (r-x------)

Chmod files, not directories



File files only, starting in the current directory, executing chmod 644 on the found files, including files with spaces and starting with -


[user@localhost ]# sudo find . -type f -exec chmod 644 -- {} +

Saturday, September 30, 2017

Sort files on usb stick for car (fat filesystem)

dnf install fatsort
sudo umount /dev/sde1
sudo fatsort /dev/sde1

Monday, June 26, 2017

Start VPN from command line in Fedora

Use nmcli command


[user1@localhost ~]$ nmcli c 
NAME            UUID                                  TYPE            DEVICE 
eno1            c9----------91  802-3-ethernet  eno1   
virbr0          fb----------a3  bridge          virbr0 
Canada          67----------3d  vpn             --     
US-East         b3----------5a  vpn             --     
United-Kingdom  eb----------5f  vpn             --     


[user1@localhost ~]$ nmcli c up b3----------5a
VPN connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/1)


[user1@localhost ~]$ nmcli c down b3----------5a
Connection 'US-East' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/1)