Blog: TTTThis

Print books with LibreOffice

Garamond font

Remember, you have to put the same stack of paper into the printer twice (once for even numbers, once for odd). You just take the stack that's printed the first time, and put it back in the feed tray exactly as it sits in the already-printed tray.

Formatting:

  • (Not columns) (or yes)
  • Font-size:16 (18 is a bit big)
  • Insert > Footer
  • Insert > Page number
  • Center the footer page number the regular way
  • Format > Page style > Margins: Make Top and Bottom each 0.05
  • Right click all selected text > Paragraph style > Spacing: Below paragraph 0.2
  • Right click all selected text > Paragraph style > Line spacing: Fixed 0.1

Printing:

  • even pages
  • brochure

Second print on same pages:

  • odd pages
  • reverse order
  • brochure

Image

OR:

Formatting:

  • Right click all selected text > Paragraph style > Spacing: Below paragraph 0
  • Right click all selected text > Paragraph style > Indent: First line 0.35

Image


Printing

Make sure to set paper size each time

then re-organize the pages you printed so first is last (deal them down onto your desk)

TTTThis

Printing on shirts

Sublimation only works on Polyester.

Heat Transfer Printing HTV is using a Plotter-Cutter and ironing on the vinyl after you cut it. One color. However, you can also get vinyl you can print on with a regular inkjet. Also, there is a special printer called a White Toner Transfer Printer (such as the Ricoma R550) which apparently prints vinyl onto clear paper, I guess.

PRODUCTS:

Cricut brand HTV holds up best (according to a test I watched)- 35 washes without cracking). B flex is less durable.

TTTThis

Epson EcoTank L3210 printer on Linux

Newer:

Epson L320. Doesn't work if you just plug into Kali

3 driver files.

  • Install the lsb one first (the others depend on it), but it needs internet to download the required parts for it
  • worked after installing the 3 things. (Not sure if it might work after just 1 or 2)
  • Later I bought a L3250 and it didn't plug and play, so I got its driver from Epson (then it goes to another site for Linux drivers), still no, so I installed the 3 .deb packages shown here also, and it worked (after reboot).

This image shows stuff. Might not need all of these.

Image


Drivers from Epson:

http://download.ebz.epson.net/dsc/search/01/search/searchModule

I think you just need the top 2, or maybe just one of them. On a 64-bit Debian install you should have selected the AMD64 versions. To check your system for 32 or 64 bits, do uname -a in Terminal.

They won't work, because Debian obsoleted lsb 3.2. You have to install it (actually, just something similar called lsb-compat) from:

http://ftp.debian.org/debian/pool/main/l/lsb/

Select and download lsb-compat_9.20161125_amd64.deb

OK, now in Downloads, install that deb package for lsb-compat. Then install the other 2 (or 1) deb packages for the Epson drivers. Assuming they/it now installs without an error message ...

Now go to menu and Printers, select ''add' and select the Epson L3210 12321231223 one) and select 'Forward,' then 'Apply'. It will offer to do a test print and if it works, it should be installed.


Notes on printing:

  • Draft versus Standard: Draft is more blurry, softer, with lighter blacks.
  • Plain Paper versus Glossy versus Epson Matte: Plain paper can produce lines
  • Other: At least in GNU, the darkness is affected by the image (probably shouldn't be). When I print without a small pink image on the overall image (collage), it is quite light. When I print with the pink image, it's dark. Note that this wouldn't be the case if I were printing multiple images on Shotwell, where the images are considered separate.
  • If you see lines on the print, you might have to go to Print Settings on the computer and select the paper type (it was set to 'paper' and I then set it to 'glossy'.
TTTThis

CAD on linux: Blender

WATCHED - Playlist

https://www.youtube.com/playlist?list=PL6Fiih6ItYsXzUbBNz7-IvV7UJYHZzCdF It is a full series of lessons

LANGUAGE

organic modelling versus (solid, rigid) precision modelling

CONFIGURATION

  • Any changes need to be saved with File > Defaults > Save Default File
  • It doesn't have ‘single verticles’ by default. Edit > Preferences > Add-Ons > (search for Extra Objects, and) Add Mesh: Extra Objects
  • Change colors of things. Edit > Pref > Themes > 3D View ( > Wire Edit for the lines)
  • Make lines thicker. Edit > Pref > Interface > Line Width: Thick
  • Turn on Snapping. Snapping button from menu > check Absolute Grid Snapping. (Now it will snap only when you are holding down CTRL)
  • PDT tools is an add-on in Preferences
  • There's a Preference also for num pad (so you can hit the numbers on a laptop, don't need a num pad)
  • To see Statistics (how many verts, edges etc). Go to Show Overlays button (overlapping circles) and click the dropdown and check Statistics
  • You can R-click the version number in the bottom-right and do Scene Statistics
  • Measurements. Overlays icon > check Edge Length. Will appear when you select things. It will not display sizes more precise than 0.1 (not 0.15). So don't rely on Edge Length overlay
  • milimeters. Scene Properties > Units, select mm, then set unit scale to 0.001

Image

Supports 3d printing modelling and file formats since 2002.

Blender 3d object drawing (in 2d) with mirror.

  • new project and 2d object. turn on grid in top-right overlays expansion. select draw tool. then on the right side select the wrench and 'add modifier' > 'mirror'
  • you will see the mirror image in one mode and only what you drew in the other, until you 'apply' modifyer.
  • apply it, then select everything by pressing 'a', then click top-left 'object' 'convert to' 'bezier' and you can unvisible the strokes so you just see the bezier lines.
  • on the scene collectionn, you will see beside 'Lines' a little curved illustration. find the same thing below and click it. go to Geometry then Bevel.
  • go to the same spot as before and 'object' 'convert to' 'mesh'. it will look the same. NOTE it has to already be bezier curved and that has to be selected in the collection.
  • beside 'edit mode' in the top-left there's three squares. pick the middle one 'edge'
  • select what edges you want to make faces for and click 'f'

Image

TTTThis

Linux Commands

In Terminal:

2025

To invert the colors of all photos in folder (install imagemagick first)

find . -maxdepth 1 -type f -name "*.jpg" -exec mogrify -negate {} \;

To boost volume of all audio files in current folder (I think 3X) (install ffmpeg first I think)

for file in *.mp3 *.wav *.WAV *.ogg *.flac *.m4a; do
    ffmpeg -i "$file" -filter:a "volume=3.0" -c:v copy -c:a libmp3lame -q:a 2 "louder_${file}"

done

REGULAR COMMANDS

  • paste: ctrl-shift-v
  • check disk space: df -h
  • check What is computer (64 or 32): uname -a
  • check What distro is on computer: lsb_release -a
  • view image metadata (with imagemagick):
  • sudo -i to become root (also sudo su?)
  • ls - list
  • cd D and double-tab and it will show you options starting with D
  • echo “Hi!” > text.txt
  • cp text.txt Downloads - move this file to Downloads
  • rm Downloads/test.txt - remove that file
  • mv test.txt Downloads/ - physically move it
  • cd .. cd .. locate bash but it doesn't find anything, so
  • updatedb then try again
  • passwd - to change a password
  • man ls AND ls --help give some info about the command. man is manual.
  • pwd - present working directory
  • cd / - to go to root
  • Execute several commands https://stackoverflow.com/questions/13077241/execute-combine-multiple-linux-commands-in-one-line:
  • && to execute ONLY if previous command succeeded
  • ; to execute even if previous doesn't succeed
  • You can also write a shell script
  • See list of Timezones with timedatectl list-timezones
  • Upgrade a single package/program only with apt-get install --only-upgrade

usr does not mean user, it means universal system repository (or something).


INTERESTING COMMANDS

  • killall programName ... kills that process (which you might have seen using lots of resources in Terminal)
  • identify -verbose filename.png

GET INFORMATION ABOUT COMPUTER, COMMANDS

  • Find out which desktop environment (DE, for example MATE) you are using: echo $XDG_CURRENT_DESKTOP
  • top: shows RAM usage
  • lsmem: shows how much RAM you have
  • lscpu shows computer specs
  • cat /proc/cpuinfo shows even more specs
  • free -m shows free available RAM details
  • cat /proc/meminfo also
  • sblk shows available disk space
  • df -h
  • sudo dmidecode -t system
  • sudo dmidecode -t bios
  • sudo dmidecode -t processor ... these show BIOS info
  • sudo dmidecode -q will show ALL system info, but a lot
  • more commands for seeing linux sysem info: https://www.how2shout.com/linux/linux-system-info-commands-using-terminal/
  • echo $XDG_SESSION_TYPE .... Check if you're using Wayland or X11.

USEFUL COMMANDS

  • How to install .sh scripts
  • sh install.sh
  • might have to:
  • chmod +x /path/to/yourscript.sh
  • list connected devices and sd cards with: lsusb or lsblk
  • Rotate screen: xrandr -o left
  • Return to normal screen rotation with: xrandr -o normal
  • Check if you have an app, and which version it is with: applicationname -v, for example pdftoppm -v

** DISABLE TOUCH SCREEN **

  • install xinput
  • type ‘xinput’
  • you'll see a list. Find the one that is your screen/finger/digitizer and do
  • xinput disable 9 (as long as the id is 9)

YouTube-dl (outdated)

* download mp3 (using youtube-dl): 

youtube-dl -x --audio-format mp3 http:address

* download playlist as mp3s: 

youtube-dl --ignore-errors --format bestaudio --extract-audio --audio-format mp3 --audio-quality 160K --output "%(title)s.%(ext)s" --yes-playlist https:address ```


LINUX FOR ETHICAL HACKERS (YouTube course)

chmod +rwx

or just

chmod +x

or

chmod 777 hello.txt

adduser john

cat /etc/passwd

(you will see john at bottom)

cat /etc/shadow

(you can only see hashing format - a tool like hashcat can break that down and crack passwords)

...

(su is switch user)

su john

passwd root (to change root's password, but this does not work. Neither does)

sudo passwd root

(because john is not in the sudoers file)

...

userdel john

(deletes john)

networking terms - brush up for pentesting. You'll have to navigate around networks.

ifconfig (shows different interface types and IP address associated with them)

iwconfig (only usually see if using a laptop)

ping (icmp traffic)

arp -a (show you IP address it talks to and mac address tied to it)

netstat -ano (you can see what's talking) (what that machine is associated with and if it's talking on a port)

route (print your routing table) (tells you where your traffic exits, essentially)

102:00


bulk renaming with Thunar.

Use ‘Numbering’ and do ‘Text - Number’ and add your text there too.


Make a txt file: https://www.youtube.com/watch?v=T20jXu7rDCA

Nano way:

  • cd to whatvr dir
  • touch filename.txt
  • (now, ls -l will show you have that file but no size)
  • (can see contents of file with ‘cat filename.txt’)
  • (nano by itself opens the text editor n you can tipe)
  • (ctrl-shft-V does paste)
  • Ctrl-O saves the file

  • cd to directory

  • ls to check it
  • cat > filename.txt [enter]
  • type text and then [CTRL-D to save]
  • ls to check it's there
  • cat filename.txt to read it

OR

  • touch filename.txt [enter]
  • ls to see it

WAV to MP3

  • batch convert all the files in a folder from wav to mp3 using ffmpeg
  • for i in Silver0709.wav; do ffmpeg -i "$i" "${i%.*}.mp3"; done

Get Mono sound out of speakers

  • pacmd list-sinks | grep name:
  • then
  • pacmd load-module module-remap-sink sink_name=mono master=NAME_OF_AUDIO_SINK_GIVEN_BY_PREVIOUS_COMMAND_BUT_WITHOUT_ARROW_BRACKETS channels=2 channel_map=mono,mono
  • Then if you click on your sound icon, you should have an option for ‘Remapped Built-in etc’

Convert a bunch of images into a video using ffmpeg, MP4

  • ffmpeg -loop 1 -i easywords1.jpg -i easywords1.wav -vf "crop=trunc(iw/2)2:trunc(ih/2)2" -c:v libx264 -tune stillimage -c:a aac -b:a 192k -pix_fmt yuv420p -t 1480 out-image.mp4
  • ffmpeg -loop 1 -i easywords2.png -i easywords2.wav -vf "crop=trunc(iw/2)2:trunc(ih/2)2" -c:v libx264 -tune stillimage -c:a aac -b:a 192k -pix_fmt yuv420p -t 1840 easywords2.mp4

Convert MP3 to WAV

  • install mpg321 (not 123 which is a slightly worse program because not on public licence)
  • put the to-be-created wav title first
  • mpg321 -w newFile.wav “old file.mp3"
  • mpg321 -w ZOOM0061.WAV ZOOM0061.mp3

Clean metadata

ffmpeg

  • because it does a better job of combining audio with a single image than Kdenlive (which makes big files) (it has no GUI though, so use HandBrake) (I didn't find it to be very much better on initial tests)
  • Handbrake
  • add-apt-repository sudo apt-get update
  • sudo apt-get install handbrakeppa:stebbins/handbrake-git-snapshots

Chmod execute scripts

  • change mod it with (you have to be in the directory) (otherwise it will look for a system path):
  • chmod +x myscript.sh
  • to execute it then, do
  • ./myscript.sh

PDF TO TEXT

qpdf orig.pdf --pages . 420-511 -- just-the-chapters.pdf && convert -density 288 just-the-chapters.pdf output-%02d.jpg && convert output.jpg -level 25% final-%02d.jpg && convert final.jpg vr.pdf && ocrmypdf -l spa vr.pdf bookonech11-12.pdf && pdftotext -layout bookonech11-12.pdf bookonech11-12.txt && rm output* && rm final* && rm vr.pdf && rm just-the-chapters.pdf

Batch crop images (imagemagick)

mogrify*.png -crop 1x1-100-100@ *.jpg

https://deparkes.co.uk/2015/04/30/batch-crop-images-with-imagemagick/

Do

  • mogrify -crop 300x300+150+150 -path ./cropped *.png
  • An example line which is just to illustrate:
  • convert -crop x_sizexy_size+x_offset+y_offset inputfile outputfile

convert *.png -crop 350x300+150+200 *.jpg


*Modify metadata for 'date modified' (on Linux it seems that there's no ability to modify creation date, even with filesystems that allow it ie exfat etc)**

  • go to folder and put all the files you want to modify, and open a Terminal there
  • touch *
TTTThis