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)

Monday, May 15, 2017

Create PDF from multiple JPGs

install ImageMagick

dnf install ImageMagick

To create a pdf from multiple source files:

convert *.jpg output.pdf

convert and resize source images to 50% smaller:

convert -resize 50% *.jpg output.pdf

Monday, February 20, 2017

openvpn p12 file creation

openssl pkcs12 -export -in client.crt -inkey client.key -out client.p12 -name MyClient

https://syedali.net/2014/02/17/using-chromebook-to-connect-to-an-openvpn-server/

http://www.frogiswrong.com/blog/articles/8/openvpn-on-openwrt-a-little-more-detail

Sunday, January 29, 2017

Create DVD from the command line

Convert the source to an NTSC compatible DVD video format
ffmpeg  -i saltbae.mp4  -target ntsc-dvd  -aspect 16:9  saltbae.mpg

Author the DVD compatible video into the DVD container format with chapters every 5 minutes
dvdauthor  -o DVD/ -t -c 0,5:00,10:00,15:00,20:00,25:00,30:00,35:00,40:00 saltbae.mpg

Create the table of contents files VIDEO_TS.IFO
dvdauthor -T -o DVD

Done

Saturday, January 28, 2017

How to set time restrictions in Windows 10 from the command line



net user /time:,

User1 allowed to use the computer weekdays from 1-11pm

net user user1 /time:M-F,1pm-11pm

User2 allowed to use the computer Saturday from 8am-4pm, and  weekdays from 9am-9pm

net user user2 /time:Sa,8am-4pm;M-F,9am-9pm

Reset to defaults
net user user1 /time:all  


Show stats net user user1