Sunday, December 31, 2017

trim mp3 files using ffmpeg, works for video too

ffprobe.exe to get duration of MP3 in number of seconds.
   ffprobe  -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 file.mp3

ffmpeg.exe to trim away first 8 seconds, end at 999 seconds of All mp3 files in the working folder.
  ffmpeg.exe -ss 8 -t   999  -i input.mp3 -acodec copy output.mp3

Trim from 00:02:54.583 to end of file:
 ffmpeg  -ss 00:02:54.583 -i input.mp3 -acodec copy output.mp3

Works for video too:
ffmpeg -ss [start] -i in.mp4 -t [duration] -c copy out.mp4
ffmpeg -ss [start] -i in.mp4 -t [duration] -c:v libx264 -c:a aac -strict experimental -b:a 128k out.mp4


C:\ffmpeg Folder\mp3files\go.bat

echo "==========" > done.txt
for %%f in (*.mp3) do  (
    echo|set /p="..\ffmpeg.exe                         %%f                           " >> done.txt   
  ..\ffprobe  -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1  %%f  >> done.txt
)
rem Open done.txt in Excel, deduct 18 from the -t seconds     
rem (objective is to cut first 8 seconds, trim last 10 seconds of each mp3) 
rem use =concate() to reconstruct the command list, to put to new.bat
rem rearrange param, -ss and -t must precede -i

Saturday, December 30, 2017

how to turn off Accessibility button function at Windows 7's login screen

reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Utilman.exe" /v "Debugger" /t REG_SZ /d "systray.exe" /f

source: https://superuser.com/questions/196989/how-to-remove-or-disable-ease-of-access-button-on-windows-7-login-screen

Friday, November 13, 2015

turn your Linux into a router

to forward Internet request from network socket rj45 (eth0)  to wireless card (wlan0) :


su
echo 1 > /proc/sys/net/ipv4/ip_forward
/sbin/iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
/sbin/iptables -A FORWARD -i wlan0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
/sbin/iptables -A FORWARD -i eth0 -o wlan0 -j ACCEPT



done. u might need to manually configure ip address for eth0:
sudo ifconfig eth0 192.168.0.1 netmask 255.255.255.0

Friday, January 9, 2015

burn ISO file to usb drive

rufus - may use virtual OS XP in virtualBox

WinToUSB - to burn Windows >= 7, 8, 10 onto usb drive/hdd/sdd  --> portable windows

Tuesday, June 17, 2014

mklink

MKLINK [[/D] | [/H] | [/J]] Link Target

/D Creates a directory symbolic link. Default is a file symbolic link.
/H Creates a hard link instead of a symbolic link.
/J Creates a Directory Junction. (can survive remote location)
Link specifies the new symbolic link name.
Target specifies the path (relative or absolute) that the new link refers to.


in non-administrative cmd, make a new link folder (at other drive/folder) that links to C:\myFolder
mklink /J "myFolder" "C:\myFolder"


"junctions are processed at the server and directory symbolic links are processed at the client"

symbolic link:
\\Alice\c$\myjp -> \\Alice\c$\targetfolder
Junction (survive remote access):
\\Alice\c$\mysymlink -> \\Bob\c$\targetfolder

JD SimWheel use your droid as steering wheel in pc games

https://play.google.com/store/apps/details?id=jd.simwheel

It uses vjoystick as virtual device in windows, then an app in android to connect to pc & play the game!