As of November 2024 I am using k3b to burn the disks and vlc to test them (Ubuntu 20.04)
In August 2023 I used wkhtmltopdf. I had some problems with Greek characters so I had to add the following in the HTML:
<head> <meta charset="utf-8"> </head>… as advised here. Eventually, the final incantation used was:
wkhtmltopdf --disable-smart-shrinking -O Landscape -s foo.html foo.pdf
In April 2023 when trying to use unzip on a *.zip file I encountered the following message:
$ unzip staging-2023-cred.zip Archive: staging-2023-cred.zip skipping: staging-2023-cred.txt unsupported compression method 99It turns out that my unzip program was unable to unzip the archive as it used the Adavanced Encryption Standard (AES) encryption, which is not supported by unzip, at least not in the version I was using:
$ unzip -v UnZip 6.00 of 20 April 2009, by Debian. Original by Info-ZIP.After some googling I realized I had to install the 7zip package which supports AES encryption:
$ sudo apt update $ sudo apt install p7zip-full p7zip-rar… following the above, I was able to unzip using:
$ 7z e staging-2023-cred.zipNote that the archive was password-protected and I was prompted for the password by the 7z program.
for f in $(find some-dir/); do sudo touch -a -m -t 202303062145.32 $f; doneNB: the above procedure will NOT modify the "change date" of the file (ctime). The status change timestamp is shown with the stat command and is, by design, impossible to change. The only way to accomplish this would be to change the time in the entire system. See: here.
tar -cvf boo-2023-03-06.tar --sort=name --mtime='UTC 2023-03-06' boo/source
find src -regex '.*-func.tsx' -printf "%T@ %Tc %p\n" | sort -n
find src/components/ ! -type d -printf "%T@ %Tc %p\n" | sort -n
I've successfully used the following script (source):
find . -type f -name "*.csv" -print0 | while IFS= read -r -d '' file; do echo "file = $file" diff "$file" "/some/other/path/$file" read line </dev/tty done
fold -s -w80 /some/file
while inotifywait -e close_write contract.tex; do make; done
The following command removes all metadata:
$ exiftool -all= foo.png
The following command displays metadata (notice the missing equals sign)
$ exiftool -all foo.png
One can also use the mogrify program:
mogrify -strip foo.png
The program pdfjam is installed with:
sudo apt install texlive-extra-utils
I then did:
pdfjam --paper a4paper --angle 90 some-file.pdf
find . -iname \*.pdf -exec gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile='{}.2.pdf' '{}' \; -exec mv '{}.2.pdf' '{}' \;
NB: I have not found a way to specify a custom resolution that would be lower to that of /screen
sources:
hexdump, cmp and the hexl-mode of emacs
I installed the FileManager+ application on my Android device which has an option "Access from network" which I then used to download the files to my machine using the filezilla program. I tried the command-line version of ftp but it didn't support wildcards. Also, FTP support has been removed from Chrome so that wasn't an option either. Filezilla worked like a charm.
On AM's Android device I couldn't find FileManager+ to install on the app store (only on dangerous 3rd party stores) so I installed (from the app store) the WiFi File Explorer app which offered a similar FTP functionality.
update 2022-08-31. In August 2022 I used the same method with similar success on my Ubuntu 20.04 machine. I also note that, for some reason, Firefox too (besides Chrome) failed to open the FTP link. In any case, Filezilla delivered.
pdftk pg1.pdf pg2.pdf cat output all.pdf
python3 -m http.serverIt should will serve whatever's in the CWD (e.g. index.html) at http://0.0.0.0:8000.
NB: see simpler way above
source 1
source 2
I 've used the following:
convert -density 300x300 -quality 100 1.pdf 2.pdf merged.pdfAfter I was hit with:
convert: not authorized `*.pdf' @ error/constitute.c/ReadImage/412.I modified file
/etc/ImageMagick-6/policy.xmlas follows:
< <policy domain="coder" rights="none" pattern="PDF" /> --- > <policy domain="coder" rights="read|write" pattern="PDF" />
Starting off from https://security.stackexchange.com/a/2897/131157 I used the following two programs:
xev | awk '/ButtonRelease/ {print $1, i++}'
mplayer -cdrom-device -cache 5000 /dev/sr0 cdda://
On 2019-03-08 I used the qpdf tool as described in the source:
sudo apt-get install qpdf qpdf –password=password –decrypt /home/lori/Documents/secured.pdf /home/lori/Documents/unsecured.pdf… it worked like a charm.
NB: I encountered problems when trying to use the other approach suggested in the same source, namely that of using pdftk:
$ pdftk ~/Downloads/plan-to-conquer-the-world.pdf input_pw superdupersecretpwd output foo.pdf Error: Unexpected Exception in open_reader() Unhandled Java Exception in main(): java.lang.NullPointerException at gnu.gcj.runtime.NameFinder.lookup(libgcj.so.16) at java.lang.Throwable.getStackTrace(libgcj.so.16) at java.lang.Throwable.stackTraceString(libgcj.so.16) at java.lang.Throwable.printStackTrace(libgcj.so.16) at java.lang.Throwable.printStackTrace(libgcj.so.16)
NB: this no longer works as of April 2024, see updated note here.
xprop _NET_WM_PID | cut -d' ' -f3 {click on window}source
Install the awesome K3B (KDE Burning Tool) - much better than Brasero which has given me a lot of grief. The below worked like a charm in my 32-bit Ubuntu 12.04.5 LTS on July 2017.
$ sudo apt-get install k3b -y --force-yes
Launch with:
$ k3b
ffmpeg -i long-boring-cd.mp3 -vn -acodec copy -ss 00:00:00 -t 00:03:03 my-favourite-track.mp3
Most of the alsamixer settings are about the microphones. Most of the settings are about the microphones But the PCM (Pulse Code Modulation) gain control effectively controls the volume.
Pulse Code Modulation (PCM) is the primary way analog audio signals are converted into digital form by taking samples of the waveforms from 8 to 192 thousand times per second (8 to 192 kHz) and recording each sample as a digital number from 8 to 24 bits long (seesampling). PCM data are pure digital audio samples, and they are the underlying data in several music file formats (see WAV, FLAC and AIFF).
The audio-out port on a sound card provides an analog signal to the speakers; however, compressed formats such as MP3 and AAC are converted to PCM, and the PCM data are converted to analog (see D/A converter). Sound cards may also output PCM and other digital signals such as Dolby Digital (see S/PDIF). With regard to input, an analog microphone is plugged into the audio-in port, and the sound card converts the analog signals to PCM.
I recently (Autumn 2017) lost sound in two separate occassions, on two separate machines (Ubuntu 14.04 and Ubuntu 16.04). I managed to restore sound with the following two methods:
In both cases I tried playing with the alsamixer dB gains settings but that didn't fix my problem.
To verify the solutions I used:
play /usr/share/sounds/alsa/Front_Center.wav
sudo apt install pdftk pdftk ~/Downloads/mp.pdf output ~/Downloads/mp-encrypted.pdf owner_pw changeme user_pw changeme2The above incantation purposefully disallows printing the document. The owner and user passwords have to differ (I am not super-clear on the nuances).
Download the package and install it force-installing the dependencies:
sudo dpkg -i --force-depends google-chrome-stable_current_amd64.deb
In case any dependencies didn't install (you would have a warning or failure message for this), you can force them via:
sudo apt-get install -f
Increase volume by 5%
amixer -D pulse sset Master 5%+
Decrease volume by 5%
amixer -D pulse sset Master 5%-
Set volume to 50%
amixer -D pulse sset Master 50%
NB: Under i3wm I have binded the above commands to my laptop volume control keys. The bindings live in the ~/.config/i3/config file (on my Precision machine).
The installation was eventfull — I ended up using the following links:
… I ended up adding the following line:
alias skype='LD_PRELOAD=/usr/lib/i386-linux-gnu/mesa/libGL.so.1 skype'
… in the .bashrc_thisnode file for the Dell Precision laptop (where I am running Unbuntu 14.04 LTS 64 bit).
convert
(source) to, e.g. do a:convert diploma-transcript-greek-pg1-col.jpg diploma-transcript-greek-pg2-col.jpg diploma-transcript-greek-full-size.pdf
To control page size and background color you can do:
convert IMG_20190331_143038.jpg IMG_20190331_143055.jpg IMG_20190331_143110.jpg -background white -page a4 plot-signed.pdfFollowing the conversion you may wish to compress the resultant PDF file.
update When the files (e.g. PNG) are not already A4-sized I have also successfully used the below incantation:
i=150; convert dell-stuff-pg1.png dell-stuff-pg2.png dell-stuff-pg3.png -resize $(echo ${i}*8.27 | bc)x$(echo ${i}*11.69 | bc) -density ${i}x${i} -repage $(echo ${i}*8.27 | bc)x$(echo ${i}*11.69 | bc) dell-stuff.pdf… based on this answer.
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdfIf the
/screen
option results in too low quality, try /ebook
instead.
dd
and pipe the output to either xxd
or hexdump
.
$ dd if=sample-rapid-file ibs=1 skip=164 count=20 2>/dev/null | xxd -b 0000000: 00000000 00000000 00000000 10111101 00000000 00000000 ...... 0000006: 00000000 00000000 00000000 00000000 00000000 00000001 ...... 000000c: 00000000 00000000 00000000 00000000 00000000 00000000 ...... 0000012: 00000000 00000000 ..
$ dd if=sample-rapid-file ibs=1 skip=164 count=20 2>/dev/null | hexdump -C 00000000 00 00 00 bd 00 00 00 00 00 00 00 01 00 00 00 00 |................| 00000010 00 00 00 00 |....| 00000014
xxd -bp sample.dat | head -3
$ gnome-screenshot -w -d 10
gnome-screenshot --interactive
while true; do ./valgraph-harvest-wrongsets-last-30-days-html; if [[ $? != 0 ]]; then break ; fi ; done
echo "password" | md5sum... will not work as the shell also insidiously suffixes an end-of-line character.
$ echo -n password | md5sum 5f4dcc3b5aa765d61d8327deb882cf99 - $ printf '%s' "password" | md5sum 5f4dcc3b5aa765d61d8327deb882cf99 -
printf '%s\n' "password" | md5sum
define_key
function which I found useful and actually used.
~/environment/.conkerorrc/
and they of course have to be symlinked from home:
cd ln -s environment/.conkerorrc/
cat /etc/debian_version
shows):
deb http://noone.org/conkeror-nightly-debs wheezy main deb-src http://noone.org/conkeror-nightly-debs wheezy main
apt-key adv --keyserver pgp.uni-mainz.de --recv-keys 0F84088E
sudo apt-get udpate sudo apt-get install conkeror conkeror-spawn-process-helper
convert -density 300 cds-oai-dc-problem.pdf -trim -quality 100 cds-oai-dc-problem.pngBy passing -trim as an option we also get rid of a subsequent trimming step.
convert database-high-level.pdf -background White -flatten database-high-level.png(the above incantation also replaces the transparent background with white background)
convert input.png -trim output.png
sudo apt-get install diffuse
for f in $(find snapshot_dir -maxdepth 1 -type f -iname \*.xsd -o -iname \*.dtd) ; do diff `basename $f` $f ; done
for f in $(find . -maxdepth 1 -type f -iname \*.xsd -o -iname \*.dtd) ; do diff $f snapshot_dir/$f ; doneI suppose the most rigorous check is combining both ways in a single script.
sudo cat ~/Downloads/xulrunner-23.0.en-US.linux-i686.tar.bz2 | sudo tar -xj
git clone http://repo.or.cz/r/conkeror.git
sudo apt-get install nautilus-open-terminalthen, right-clicking on a folder shows option "Open in Terminal" (a log-off / log-in cycle may be necessary)
free -mt
uname -a | grep pae
grep --color=always -i PAE /proc/cpuinfo
sudo lshw
sudo lshw -html > myspecs.html
sysinfo
htop
sudo netstat -tulpnand then, once you have the PID (e.g. 3903), you can do a:
ls -l /proc/3903/exe cat /proc/3903/cmdline ls -l /proc/3903/cwd... to find more about the process.
find . -iname \*.jar | while read ANS; do DIR=$(dirname "$ANS"); cd "$DIR"; rm $(basename "$ANS"); ln -s ../../../../../../../../repo-wide-libs/$(basename "$ANS"); done
tar jcpf archive-name.tar.bz2 www/{folderA,folderB}
du -sAlso, -b to report bytes and -h for human-readable.
hash -r
lsof | grep TCP
ssh mperdikeas@172.31.129.29 'tar cpf - cluster/' | tar xpvf -
find -L -type lI.e. find files following links (-L) and report those that remain links (-type l)
ps axwww | grep conkeror | grep -v grep
or, better yet:
ps axwww | grep 'c[o]nkeror'(note: I don't see any difference with the 'axw' flags)
Once you get the pid a kill -7 should normaly suffice.
sudo apt-get install pavucontrol pavucontrol
Litmus tests:
play /usr/share/sounds/alsa/Front_Center.wav... and the Skype echo service.
Another thing to check out for is to make sure that the user belongs to the audio group. I.e. do a:
sudo \emacs -nw /etc/groupFinally, I also tried this guide on setting the default audio card although it didn't have any effect in this particular case (maybe the problem wasn't there).
sudo apt-get install indicator-sound killall unity-panel-service
To find the offending file:
$ ant 2>&1 | grep unmapp | awk '{print $2}' | sed 's,:.*,,' | sort | uniqconvert it with iconv:
iconv -f ISO8859-7 -t UTF-8(you may also have to export LANG=en_US.UTF-8)
find . -iname \*.txt -print0 | xargs -0 rm
E.g. find the package for sensors:
dpkg -S $(which sensors)
watch sensors
export http_proxy="http://foo.bar:8080"subsequent wget requests will redirect to foo.bar:8080
Typical apt commands: apt-get install, apt-cache search, apt-get autoremove, apt-get update.
#curl www.in.gr...will execute an HTTP GET against www.in.gr.
date +%s
uname -a
archx86_64 GNU/Linux indicates that you've a 64bit Linux kernel running. If you use see i386/i486/i586/i686 it is a 32 bit kernel.
grep ^flags /proc/cpuinfo | uniq | grep lm("lm" means long mode CPU - 64 bit CPU)
apt-cache search- or - dpkg --get-selections | grep
for f in `ls *.bz2` ; do tar -jtvf $f ; done | grep compile_decoder.sh... Actually, the following also works and produces identical output:
for f in `ls *.bz2` ; do tar -jtvf $f | grep compile_decoder.sh ; done
$ lsb_release -a
startxwin... and then to redirect X output from the new shell:
ssh -X mperdikeas@remote.location
$ps -u mperdikeas
uname -mrs lsb_release -a
uname -m- or -
cat /proc/cpuinfo
sudo du - s -m *(because ls -lah only displays the size of the directory file).
cp -a a bYou don't need anything else and the internal symbolic links are nicely preserved.
dpkg -S $(which lsb_release)
hexdump -Cto edit:('C' for console output)
hexedit
tail -n +2 "$FILE"
sed -i '$d' filename
head -`wc -l thefile | awk '{print ($1-1)}'` thefile