Tag Archive for 'Zen Burn'

Bash and *nix Note no. 1

7 July 2023:
Ubuntu 22.04′s update notifier seems to not include the option to configure any settings, at least after certain conditions exist on a particular system.  To stop the notifier from appearing.  To stop the notifier from appearing use

sudo apt-get remove update-notifier

7 July 2023:
There are non-snap builds of ungoogled-chromium for Ubuntu

6 July 2023 and prior:

To disable automatic updates on Ubuntu:

sudo dpkg-reconfigure unattended-upgrades
sudo apt remove packagekit

In .bashrc create the following alias:

alias nano="nano -c --guidestripe 80"

This will open always Nano with line and column numbering along with a long line marker at the specified column. The long line marker feature works for Nano version higher than 4, which doesn’t include the version in the CentOS 7 repositories.

In .bashrc add the following line:

export DISPLAY=\
"`grep nameserver /etc/resolv.conf | sed 's/nameserver //'`:0"

This adds the IP address of the instance to the display variable for use with Windows Subsystem for Linux and VcXsrv.

In .nanorc add the following items. The first two lines are commented because the command line switch used in the alias for the line numbers creates no artifacts when using copy-paste.

#set linenumbers
#set constantshow

# https://www.nano-editor.org/dist/latest/nanorc.5.html
set guidestripe 80

include /usr/share/nano/autoconf.nanorc
include /usr/share/nano/patch.nanorc
include /usr/share/nano/nanorc.nanorc
include /usr/share/nano/groff.nanorc
include /usr/share/nano/awk.nanorc
include /usr/share/nano/man.nanorc
include /usr/share/nano/java.nanorc
include /usr/share/nano/sh.nanorc
include /usr/share/nano/po.nanorc
include /usr/share/nano/texinfo.nanorc
include /usr/share/nano/python.nanorc
include /usr/share/nano/perl.nanorc
include /usr/share/nano/pov.nanorc
include /usr/share/nano/ocaml.nanorc
include /usr/share/nano/tcl.nanorc
include /usr/share/nano/debian.nanorc
include /usr/share/nano/lua.nanorc
include /usr/share/nano/xml.nanorc
include /usr/share/nano/gentoo.nanorc
include /usr/share/nano/objc.nanorc
include /usr/share/nano/tex.nanorc
include /usr/share/nano/guile.nanorc
include /usr/share/nano/php.nanorc
include /usr/share/nano/c.nanorc
include /usr/share/nano/nftables.nanorc
include /usr/share/nano/spec.nanorc
include /usr/share/nano/elisp.nanorc
include /usr/share/nano/ruby.nanorc
include /usr/share/nano/go.nanorc
include /usr/share/nano/nanohelp.nanorc
include /usr/share/nano/default.nanorc
include /usr/share/nano/json.nanorc
include /usr/share/nano/css.nanorc
include /usr/share/nano/mgp.nanorc
include /usr/share/nano/asm.nanorc
include /usr/share/nano/mutt.nanorc
include /usr/share/nano/javascript.nanorc
include /usr/share/nano/postgresql.nanorc
include /usr/share/nano/rust.nanorc
include /usr/share/nano/fortran.nanorc
include /usr/share/nano/cmake.nanorc
include /usr/share/nano/makefile.nanorc
include /usr/share/nano/html.nanorc
include /usr/share/nano/changelog.nanorc

Using Tar and Gzip:

tar -zcvf output_file_name[.tar.gz or .tgz] directory_to_compress

tar -Jcvf output_file_name[.tar.xz] directory_to_compress
reads compression level for XZ from environmental variable, but note that xz utils is not installed by default on ubuntu 10.04

tar -xvf works to extract .tar.gz file created like in the above

The Tar and Gzip commands use compression settings specified in .bashrc

export GZIP=-9

export XZ_OPT=-9

Add the following to .bashrc for a console calculator:

calc() { echo "$*" | bc -l; }

For the ll alias, use the following in .bashrc

alias ll='ls -alF'

To change the terminal name use the following in .bashrc.  The command differs depending upon which version of Gnome one uses.

# For older versions of gnome-terminal
#shellrename() { read -p "Enter new shell name: " name && PROMPT_COMMAND='echo -ne "\033]0;${name}\007"'; }
# Works on OpenSUSE 15.3
#PS1=$PS1"\[\e]0;test1\a\]"
shellrename() { read -p "Enter new shell name: " name && PS1=$PS1"\[\e]0;${name}\a\]"; }

To obtain a uuid, add the following to .bashrc:

uuid() { UUID=$(cat /proc/sys/kernel/random/uuid) && echo $UUID;

Zen Burn color scheme for the terminal, but sometimes causes problems with work via SSH.

# Zen Burn
# Another old way that works great in gnome-terminal while causing problems
# in some configurations involving SSH:
echo -ne '\e]12;#BFBFBF\a'
echo -ne '\e]10;#DCDCCC\a'
echo -ne '\e]11;#3F3F3F\a'
echo -ne '\e]4;0;#3F3F3F\a'
echo -ne '\e]4;1;#705050\a'
echo -ne '\e]4;2;#60B48A\a'
echo -ne '\e]4;3;#DFAF8F\a'
echo -ne '\e]4;4;#506070\a'
echo -ne '\e]4;5;#DC8CC3\a'
echo -ne '\e]4;6;#8CD0D3\a'
echo -ne '\e]4;7;#DCDCCC\a'
echo -ne '\e]4;8;#709080\a'
echo -ne '\e]4;9;#DCA3A3\a'
echo -ne '\e]4;10;#C3BF9F\a'
echo -ne '\e]4;11;#F0DFAF\a'
echo -ne '\e]4;12;#94BFF3\a'
echo -ne '\e]4;13;#EC93D3\a'

Circa 2015: Adding Windows to CentOS 7 and Grub 2 after installing CentOS and no automatic configuration of Windows boot options. The file to manually edit is /etc/grub.d/40_custom.

menuentry "Windows 10 Professional" { set root=(hd0,1) chainloader +1 }

After editing, update Grub and reboot using the following command.

grub2-mkconfig –output=/boot/grub2/grub.cfg

The following shows one of the custom file contents circa 2018 or 2019 after some changes to installers and autodetection.

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the menu entries you want to add after this comment.
# Be careful not to change the 'exec tail' line above.
menuentry "Windows (system) (on /dev/sda1)" --class windows --class os { insmod part_msdos insmod ntfs insmod ntldr set root='(hd0,msdos1)' ntldr ($root)/bootmgr}