Using BlueFish on Ubuntu

Currently you cannot define your own shortcuts keys, this really stinks because to join lines takes three key strokes. It does provide color coding and some extra goodies.

Configure HTML tidy, by adding extra filter settings.

Refer: http://www.gtalbot.org/linux-section/web-authoring/html-tidy/how-to-use-HTML-tidy-with-bluefish.html

Edit, Preferences, "External Filters"

|tidy -utf8 --clean yes --doctype strict --drop-font-tags yes --drop-proprietary-attributes yes --enclose-block-text yes --enclose-text yes -indent --logical-emphasis yes --output-html yes --replace-color yes --show-warnings no --wrap 1024|

Addtional Configurations for HTML Tidy

Refer: http://tidy.sourceforge.net/docs/quickref.html

Map Mouse Buttons in Ubuntu

Map_Mouse_Keys.pdf

Special HACK when using mouse with ONLY 3 buttons and you want pushing the scroll wheel to close tab.

# NOTE: SIMPLE MOUSE - SCROLL WHEEL CLICK TO CLOSE TAB
"xdotool key 'Control_L+w'"
        b:2

Sample Bindings:
xbindkeysrc

meld ~/.xbindkeysrc ~/Desktop/xbindkeysrc.txt

Refer: https://www.linuxuprising.com/2019/11/how-to-bind-mouse-buttons-to-keyboard.html

Install the tools:

sudo apt install xbindkeys x11-utils xdotool

Grab the mouse button codes:

xev | grep button

Next, focus the small window that pops up and watch the terminal output. Now press the mouse button for which you want to grab the code. After pressing the button you should see its code in the terminal where you ran xev, e.g.:

Results

Left Scroll Wheel Click
state 0x10, button 6, same_screen YES

Right Scroll Wheel Click
state 0x10, button 7, same_screen YES

Grab the keystrokes that we'll later send using a mouse button (skip if you want to bind a command / script / program to a mouse button)

Run the following command:

xev | sed -ne '/^KeyPress/,/^$/p'

For [Ctrl]+[w], results

KeyPress event, serial 37, synthetic NO, window 0x3200001,
    root 0x5a9, subw 0x0, time 1609319, (114,64), root:(200,166),
    state 0x10, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 37, synthetic NO, window 0x3200001,
    root 0x5a9, subw 0x0, time 1609946, (114,64), root:(200,166),
    state 0x14, keycode 25 (keysym 0x77, w), same_screen YES,
    XLookupString gives 1 bytes: (17) ""
    XmbLookupString gives 1 bytes: (17) ""
    XFilterEvent returns: False

Note down the keycode, keysim or name of the key. You can use any of the 3, e.g. for the first key above you can use either 37, 0xffe3, or Control_L. In this article I'll use the key name (e.g. Control_L for left control key) since they are easier to read.

Create the xbindkeys configuration (in ~/.xbindkeysrc).

You may either create an empty ~/.xbindkeysrc file, or generate a sample configuration file using this command:

xbindkeys -d > ~/.xbindkeysrc

Next, open ~/.xbindkeysrc with your favorite text editor. Note that .xbindkeysrc is a hidden file in your home directory so you'll need to press Ctrl + h (to show hidden files and folders) to see it in your file manager.

To bind a mouse button to a key combination, paste the following at the end of the ~/.xbindkeysrc file (it may already contain some key binds, it may contain the sample configuration or it can be empty - it doesn't matter):

"xdotool key 'KEY-COMBINATION'"
       b:MOUSE-BUTTON-CODE

Where:

  • KEY-COMBINATION are the keystrokes you got under step 3 (separate the keys with a + sign)
  • MOUSE-BUTTON-CODE is the mouse button code that you got under step 2

Example:

# NOTE: MAP LEFT SCROLL WHEEL CLICK TO CLOSE TAB
"xdotool key 'Control_L+w'"
        b:6

# NOTE: MAP LEFT SCROLL WHEEL CLICK TO CLOSE WINDOW
"xdotool key 'Control_L+W'"
        b:7

This remaps the mouse button 8 (which for my mouse is the button that can be used as a back button in a web browser for example) to Control_L+Alt_L+Down which in GNOME Shell is used to switch to workspace down.

To bind a command, script or program to a mouse button, use this in the ~/.xbindkeysrc file:

"COMMAND"
       b:MOUSE-BUTTON-CODE

Here:

  • COMMAND is a command, script or program
  • MOUSE-BUTTON-CODE is the mouse button code that you got under step 2

Example for running a program using a mouse button:

"firefox"
       b:8

This starts Firefox when pressing mouse button 9 (which for my mouse is the button that can be used as a back button in a web browser for example).

Start xbindkeys.

Now you can start xbindkeys using a terminal and typing:

xbindkeys

In case xbindkeys was running, you can get it to use the new configuration by issuing; however, I found I needed to just reboot.

xbindkeys --poll-rc

Map Escape Key to Caps Lock and Other Tweaks

Refer: https://dev.to/yuyabu/how-to-use-caps-lock-key-as-esc-on-ubuntu-18-1g7l

Gnome Tweaks as a "Keyboard & Mouse Section", "Addtional Layout Options"

Currently using two tweaks because my old USB keyboard for an iPad DOES NOT have an escape key.

Choose "Caps Lock behavior', "Make Caps Lock and addtional Escape"

Since Caps Lock is remapped also adding a tweak to make using both shift keys to enable Caps Lock, and one shift key to disable Caps Lock

"Miscellaneous Compatibility Options", "Both Shift together enables Caps Lock; one Shift key disbles it"

Cups Printer Management from Command Line

Refer: https://www-uxsup.csx.cam.ac.uk/pub/doc/suse/suse9.1/adminguide9.1/ch05s07.html

Sample Commands

Help

lpstat --help

General Status

lpstat -t

List of Printers

lstat -v

5.7.3.Using Command-Line Tools for CUPS Troubleshooting

Print jobs will be kept in the printer queue if you shut down the system while a job is being processed. This means a broken print job will still be there even after rebooting and you need to remove it from the queue manually with the commands mentioned above.

Other problems occur if there is some fault in the physical data link between the computer and the printer. The printer may then be unable to make sense of the data it receives and start spitting out lots of pages with garbage on them.

To make sure the printer stops working, first remove all paper from it (in the case of inkjet printers) or open the paper trays (laser printers).

At this point, the print job will often still be in the queue, because jobs are only removed from the queue when all data has been sent to the device. Check which queue is currently printing by entering

lpstat -o

Then remove the problematic print job wit

cancel queuename-jobnumber

Some data might still find their way to the printer in spite of the job having been deleted. To stop this, enter the command fuser -k /dev/lp0 (for a printer at the parallel port) or fuser -k /dev/usb/lp0 (for a USB printer). This kills any processes still using the printer device.

Do a complete reset of the printer by disconnecting it from power for some time. Then put in the paper and switch the printer back on.

Torchlight II – God Mode Console

Refer: https://steamcommunity.com/sharedfiles/filedetails/?id=126856835
Refer: https://support.arcgames.com/hc/en-us/articles/360017560214-How-to-open-the-in-game-console-on-Mac-OS-X

On MacBook

/Users/mruckman/Library/Application Support/Steam/steamapps/common/Torchlight II/my games/runic games/torchlight 2/save/76561198320634829/settings_sdl2.txt

Change CONSOLE :0 to CONSOLE :1

[Option]+[r] or [Option] + [r] on mapped keyboard

Open Console on Ubuntu

gedit "/home/mruckman/.steam/steam/steamapps/common/Torchlight II/my games/runic games/torchlight 2/save/76561198320634829/settings_sdl2.txt"

gedit "/home/mruckman/.steam/debian-installation/steamapps/common/Torchlight II/my games/runic games/torchlight 2/save/76561198320634829/settings_sdl2.txt"

[Insert] Key

Note: Replace “###” with numbers, and remove all parentheses, and quotation marks.

GOD : Toggles invincibility on/off.
GODSPEED : Toggles invincibility and extra speed on/off.
LEVELUP : Gain XP to level up.
AIFREEZE : Toggles Monster AI on/off.
PLAYERNOTARGET : Toggles Monster targeting on/off. (Ghost Mode)
KILLALL : Kills all monsters.
ALWAYSCRIT : Player always hits critically.
ASCEND : Goes down a floor.
DESCEND : Goes up a floor.
MONEY ### : Sets amount of gold to “###”.
ALLITEMS : Spawns all items.
CLS : Clears console history.
SETTIME ### : Sets the time of day to “###”.
SETTIMESCALE ### : Sets the timescale for time of day to “###”.
ROOM : Returns the room the player currently is in.
FPS : Shows the frame rate and other information.
SPEED : Toggles additional speed for the character.
DAMAGE SHAPES : toggles damage shapes on and off.
STATPOINTS ### : Gives you stat points set to “###”.
STRENGTH ### : Gives you melee points set to “###”.
DEXTERITY ### : Gives you ranged points set to “###”.
MAGIC ### : Gives you magic points set to “###”.
DEFENSE ### : Gives you defense points set to “###”.
ALLSTATS ### : Gives you the count to all stats to “###”.
FAME ### : Gives you fame points set to “###”.
SKILLPOINTS ### : Gives you skill points set to “###”.
SETPETLEVEL : Sets the pet’s level set to “###”
DISABLEPET : Disables/enables the player’s pet.
RELOAD : Reloads textures.
PATHING : Toggles pathing debug display.
COMBATLOG : Toggles combat log.
SOUNDDEBUG : Toggles sound debug.
CLEARHISTORY : Clears level history.
MISSILETRAILS : Shows missile trails.
DEBUGLOGIC : Toggles if the logic events are fired to the ogre log.
NOXP : Player doesn’t gain XP.
ANIMATIONSPEED ### : Changes the animation of everything to match the FPS.
HURTME ### : Reduces the player and the player’s pet HP by the given percent.
RESETSTATS : Resets the player’s stat points.
RESETSKILLS : Resets the player’s skills.
RESETPLAYERLEVEL : Resets the player’s level to 1.
RESETPETLEVEL : Resets pet’s level to 1.
RESETPLAYER : Resets player’s stats, skills, and level.
CAMERADISTANCE ### : The ### the camera will be from the player.
DIFFICULTY: Displays the current game difficulty.
SETDIFFICULTY ### : Sets the current difficulty, values range from (0) Easy to (3) Very Hard.
SKILL name/index = type just skill to see a list of skills. Type the number or the name of the skill to make active on the player.
SKILLTEST = different in the command skill, this will allow you to execute any skill even if it wasn’t intended for your character.
ITEM index,count = the params are option. Type items to see indexes of all monsters in the game.
ITEM itemName,count = creates count of itemName.
ALLITEMS unittype = spawns all items of a given unittype (use “_” for spaces)
IDENTIFYALL identify all items in the player’s inventory.
ANY index,count = the params are option. Type any to see indexes of all units in the game.
EDITOROBJECT objectName,count = Creates an object from the editor for testing memory use.
UNIT unitName,count = creates a unit by name and count.
SPAWNCLASS spawnclassName,count,level = just type spawnclass to see all the spawn classes listed. Pass in Zero or a negative number for level will use the dungeon depth as the level.
MONSTER index,count = the params are option. Type monster to see indices of all monsters in the game.
MONSTER monsterName,count = creates count of monsterName
MONSTERMEM MonsterName,### = the params are option. Creates and deletes a monster for memory testing.
MODEL modelpath,### = the params are optional. Creates and deletes a model for memory testing.
DUNGEON dungeonName = sets the current dungeon
CLEANUP = releases unused resources
CHARGEBARMULT = makes the charge by X percent easier to fill
UNITTYPES = displays all unittypes
RESTARTLEVEL = restarts the current level
QUESTS = lists all quests
QUESTACTIVE questName = sets a quest to active
QUESTSHOWACTIVE = Shows all the players active quests
QUESTCOMPLETE questName = sets a quest to complete
QUESTRESET questName = resets a quest to not be active or complete
QUESTSCOMPLETE = Lists all the quests complete
SHOWBLOOD = toggles blood particles
ACHIEVEMENTS = Lists the achievements and if they are complete
MEMORY = Dumps the memory allocation to the console.
TAGS = Dumps all tags used in the level and what got created.
ITEMBYMESH = Pass in part of a mesh name to spawn all items with that contain the string you passed.
UIREFRESH = forces a refresh on the UI.
MODIFYSIGHT = changes the sight distance of monsters activation. Pass 0 to reset.
MODIFYMOTION = changes the motion distance of monsters activation. Pass 0 to reset.
CHARACTER COUNT = returns the number of characters updating in the level
PLAYERANIMATION = Dumps to the console which animation the player is playing and stopping.
DOLLYMIN mindis = The min dolly distance for interaction.
BLOOM = Toggle fullscreen bloom.
LOGCONSOLE = Show the logging console.
CONNECTIONDATA = Dump a connection data file.
ADDFRIENDBYUSER = Add a friend by username or email.
DROPCONN = Drop the given connection id.

diceware – To generate passwords

Refer: http://manpages.ubuntu.com/manpages/bionic/man1/diceware.1.html

Sample Usage
Four words, and separate by dash

$ diceware -n 4 -d -

Installation
$ sudo apt-get update -y
$ sudo apt-get install -y diceware