Listing posts

Displaying posts 206 - 210 of 328 in total
Remove NOOBS from RaspberryPi sdcard
mouse 3177 · person cloud · link
Last update
2019-01-12
2019
01-12
« — »

After installing NOOBS you will have this sdcard partition table (eg. 16GB sdcard):

1
root# sfdisk -d /dev/mmcblk0
1
2
3
4
5
6
7
8
9
10
label: dos
label-id: 0x00084f9c
device: /dev/mmcblk0
unit: sectors

/dev/mmcblk0p1 : start=        8192, size=     2280871, type=e
/dev/mmcblk0p2 : start=     2289063, size=    28827225, type=5
/dev/mmcblk0p5 : start=     2293760, size=       65534, type=83
/dev/mmcblk0p6 : start=     2359296, size=      129024, type=c
/dev/mmcblk0p7 : start=     2490368, size=    28625920, type=83

and we have to create another one like this (eg. 32GB sdcard):

1
2
3
4
5
6
7
label: dos
label-id: 0x00084f9c
device: /dev/sdc
unit: sectors

/dev/sdc1 : start=        8192, size=       85405, type=c
/dev/sdc2 : start=       94208, size=    62239744, type=83

save the last output to a file sdcard.ptable and:

1
2
3
4
5
6
7
8
9
10
11
12
13
# write partition table
sfdisk /dev/sdc < sdcard.ptable

# format partitions
mkfs.vfat -v /dev/sdc1
mkfs.ext4 -m 1 -b 4096 -O ^metadata_csum -v /dev/sdc2

mkdir src dst

# copy partition 1 data
mount /dev/mmcblk0p1 src
mount /dev/sdc1      dst
rsync -avihh --stats --progress --inplace --delete --delete-before --delete-excluded src/ dst/

edit cmdline.txt and set the correct boot partition with root=PARTUUID=00084f9c-02, then:

1
2
3
4
5
6
7
umount src dst

# copy partition 2 data
mount /dev/mmcblk0p1 src
mount /dev/sdc1      dst
rsync -avihh --stats --progress --inplace --delete --delete-before --delete-excluded src/ dst/
umount src dst

and edit etc/fstab with the correct partition labels :

1
2
PARTUUID=00084f9c-01  /boot           vfat    defaults          0       2
PARTUUID=00084f9c-02  /               ext4    defaults,noatime  0       1

Note: Alternatively you can also update the NOOBS installer.


Source: Remove NOOBS and migrate Raspbian to new microSD card, Raspberry Pi 3 Model B+ Will Not Boot!,


~~~ * ~~~

Convert DVD subtitles from VOBsub to SRT
mouse 3374 · person cloud · link
Last update
2019-01-10
2019
01-10
«converting dvd subs from vob to srt»
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# install tools
apt-get install mplayer mencoder vobsub2srt tesseract-ocr-ita

# detect subtitle ID from the main track
mplayer -dvd-device dvd.iso -identify 'dvd://2'

# extract DVD subtitles to VOBsub file
mencoder -nosound -ovc copy -dvd-device dvd.iso -aspect 16:9 \
  -o /dev/null -vobsubout subtitles -vobsuboutindex 0 -sid 0 \
  'dvd://2'

# convert VOBsub to SRT format
vobsub2srt --lang it subtitles

# check spelling with libreoffice
soffice subtitles.srt

~~~ * ~~~

SSHD on windows via Cygwin
mouse 1663 · person cloud · link
Last update
2019-01-02
2019
01-02
« — »
  1. Install packages: openssh and cygrunsrv

  2. Setup and autorun service:

1
2
ssh-host-config -y
cygrunsrv -S sshd
  1. Enable sshd on windows firewall:
    Control Panel > Windows Firewall > Allow a program or feature through Windows Firewall > Allow another program... > type C:\cygwin\usr\sbin\sshd.exe

~~~ * ~~~

Show .torrent contents
mouse 1372 · person cloud · link
Last update
2018-12-14
2018
12-14
« — »
1
2
3
apt-get install bittorrent

btshowmetainfo file.torrent

~~~ * ~~~

Convert audio/video file to MP3
mouse 2055 · person cloud · link
Last update
2018-12-12
2018
12-12
«ffmpeg flac m4a mp3»

FFmpeg convert-all

Install ffmpeg:

1
2
3
4
5
6
# debian 8 jessie
apt-get install libav-tools
alias ffmpeg=avconv # put this in your ~/.bashrc

# debian 9 stretch
apt-get install ffmpeg

or just download a static build from the nice John Van Sickle (choose armhf-32bit for the raspberry pi).

Then use it to convert all your files:

1
2
3
for f in *.flac , *.m4a , *.ogg ; do
  ffmpeg -i "$f" -ab 320k "${f%.m4a}.mp3"
done

Note: In case of Too many packets buffered for output stream error use -max_muxing_queue_size option with a higher number (start at 1000).

FLAC to MP3 via custom encoder

1
flac -c -d in.flac | lame -m s -h -b 256 - out.mp3