Blog: 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

Parrot OS

(Had to give up on Parrot. Things stopped working constantly. Terminal stopped opening on ctrl-alt-t. Double quotaiton marks started printing @ instead (on desktop environment (Mate), not in a VM where it printed the double quotes). Printers stopped being detected. Batter warnings started popping up constantly when charging, until I disabled them in DConf. Menus were buggy. Computer froze sometimes. Dec 2021.)

  • LMMS
  • GNU
  • Leafpad
  • Kden
  • Gnome disks
  • Gparted
  • Screenshot
  • Thunar
  • Vokoscreen
  • Oracle VM
  • Firefox
  • LibreOffice
  • Task Manager

STEPS:

Menu 'Startup applications' turn off bluetooth

Menu 'Control Center' > Mouse preferences > Touchpad > uncheck 'Enable natural scrolling'

remove snapd vlc audacity add gnome-disks gedit thunar secure-delete youtube-dl

sudo apt autoremove --purge snapd ; sudo apt-get autoremove vlc-nox ; sudo apt-get purge vlc ; sudo apt-get autoremove ; sudo apt-get purge vlc-data ; sudo apt-get autoremove --purge vlc ; sudo apt-get remove browser-plugin-vlc ; sudo apt-get autoremove ; sudo apt-get purge audacity ; sudo apt-get autoremove ; sudo apt-get autoclean ; shred -rf ~/.audacity-data/ ; rm -rf ~/.audacity-data/ ; just sudo apt-get install gedit ; sudo apt-get install thunar ; sudo apt-get install secure-delete ; sudo apt-get install youtube-dl

sudo sfill -f /home

To install printer driver (deb package, missing dependencies and had to sudo apt-get install -f (twice actually). Then I could install the lsb-compat and then the epson-printer-utility. I had to install 2. So next time try just the second deb option first.

installed shotwell

installed virtualbox

sudo apt-get update, and redit above mass command (this time it did some more)

TTTThis

Notes on Alesis SamplePad - Load your own samples

USE 32gb or less SD card (larger won't be recognized).

ALL SAMPLES must be 16bit wav files. Must be 16bit, 48000, mono. Program from Alesis to do this: https://www.alesis.com/products/view2/samplepad-pro (No linux).

Don't make folders (you won't be able to find them). Make samples like 8 characters so you can read them on the display.

Hold down-arrow and right-arrow for 2secs.

Tutorial: https://www.youtube.com/watch?v=qIx82tGYIQQ

Tutorial: https://www.youtube.com/watch?v=Ga7IEBICoKQ

Comment by Sean Combs:

Great tutorial. I have a few additions.

  1. COPY KIT is ALMOST the only way to create a NEW KIT. All new kits are created on the SD Card. No SD Card, NO NEW KIT. Once it's copied, change the pad sounds to what you want on the new kit, and SAVE.
  2. An option to #1 above, You can put your SD Card in your computer and copy / paste .KIT files (inside the KIT older) but you need to rename the copy. File name is limited to 8 characters. (See #4 below). The only way to get new sounds assigned to this new kit is through the Alesis Sample Pad Menu. This allows you to quickly create as many new kits as you want but you will still have to edit the sounds assigned to the kit on the Sample Pad.
  3. You can change the name of your created Kits. With your SD Card in your computer, open the folder named "KITS". You will see files such as USER_001.KIT. You can change the USER_001 portion to whatever you want, with no special characters (except _), no spaces, and it CANNOT be more than or less than 8 characters before ".KIT". For example, I use a certain kit for our cover song by Stone Sour. I renamed USER_001.KIT to STONSOUR.KIT. The kit will still be named "KIT 11" in the left corner of the Alesis screen, but the center top of the screen shows "STONSOUR" (The File Name) . As I mentioned in #3 above, it takes about 20 seconds for all 8 of my custom sound files to load to this kit.
TTTThis

Notes on digital pianos (LMMS)

Add soundfont to LMMS to have a piano

  1. Go to http://schristiancollins.com/generaluser.php and download 'GeneralUser GS 1.471'. This is also the name of the sf2.
  2. Extract the contents of the zip into your LMMS Samples folder. (You can find/set this in Edit > Settings Now restart LMMS and go to Samples and find that thing.

Tutorial: https://www.youtube.com/watch?v=IAmZZzyE8cY

TTTThis