Wednesday, February 20, 2019

Extend Windows Server 2012 R2 evaluation period


1) Command prompt  (CMD) as Administrator
2) Run

     C:> slmgr.vbs /rearm

to reset the evaluation status

3) Reboot to take effect.


Sunday, August 5, 2018

Rsync recursively transfer one or multiple directory to another



 rsync -avhP  --progress Movies TV  /mnt/sdc5/media

-a copy archive bits
-v verbose
-h human readable
-P copy partial + progress

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 -- {} +