[ / / / / / / / / / / / / / ] [ dir / random / 55sync / ara / biz / fringe / inbouron / jewess / leo / qrb ]

Catalog (/slackware/)

[Create a thread]
Sort by: Image size: [Show all]
R:0 / I:0 / P:1 [R] [G] [-]

Welcome to #slackware

This is a board for #slackware@irc.rizon.net

That is an IRC Channel hosted by Rizon. You can connect to it with an IRC Client, such as BitchX, HexChat, Pidgin, AdiIRC, WeeChat, Irssi, EPIC or mIRC (Windows).

The IRC Server is Rizon (irc.rizon.net) and the channel is #slackware (once connected, /join #slackware).

There are two sister channels for #slackware, named ##linux (created for all Gnu/Linux distributions) and ##python (created for Python Programmers).

More Rizon Server details here: https://wiki.rizon.net/index.php?title=Servers

P.S.: Many thanks to the 8kun.top administration for fully restoring this board! And not a single thread was lost! :)

R:1 / I:0 / P:1 [R] [G] [-]

$HOME/.elvisrc

Elvis is a vi/ex clone and is also Slackware's default vi text editor.

In this thread I won't get into Elvis's commands, but paste my $HOME/.elvisrc instead in the hopes that it's useful for those who use Elvis regularly like I do.

$HOME/.elvisrc is one of the locations where Elvis reads its user configuration file.

You can find the documentation for Elvis online on the internet, or by typing ":help" inside Elvis. This will open the on-line documentation in a new window though. To close the other window, use ctrl+w, w to switch to it, then ":q" to close it.

$ cat .elvisrc

set autoindent

set number

set report=1

set ruler

set scroll=24

set showmatch

set showmode

color normal brightwhite

color lnum yellow

color selection white

color comment lightgreen

color string lightred

color char brown

color number yellow

color function lightcyan

color variable lightmagenta

color link cyan

If you wish to disable "set number" with a file open for example, type ":set nonumber".

Happy text editing!

Compass.

R:59 / I:0 / P:1 [R] [G] [-]

Anti Deletion Thread

Hi there.

https://8kun.top/faq.html#help-my-board-has-been-deleted: "On 8kun, any board may be automatically deleted if it receives no new posts for four (4) weeks."

https://8kun.top/faq.html#i-lost-ownership-of-my-board-what-happened: "You may lose access to your board if you fail to log in for two weeks."

Since this board is very low on traffic, I've created this thread to create dummy posts, so my board isn't deleted.

Compass.

R:0 / I:0 / P:1 [R] [G] [-]

Free VPS at ##linux@irc.rizon.net

Hi.

User spurthi has made available his Free VPS through his bot "[VM][US]VMDeploy" in ##linux@irc.rizon.net

Type !vm in ##linux@irc.rizon.net to get access or read more at https://vmbot.fsirc.net

Enjoy!

Compass.

R:0 / I:0 / P:1 [R] [G] [-]

Slackware 15.0 Release

This is a late post but better than never!

Slackware 15.0 has been released!

There are no official torrents, but you can easily download them here: https://seedbox.slackware.uk/

Compass.

R:6 / I:4 / P:1 [R] [G] [-]

Python Programs

Hi there.

I've decided to remove all my programs from this thread. It's meaningless to post and update my source code both here and on GitHub. Besides, formatting source code so it's readable in a post is somewhat troublesome and unnecessary work.

Therefore from now on I'll be referencing all my source code in GitHub instead.

Whenever I post a new program on GitHub, I'll advertise it here with a new post in this same thread.

GitHub: https://github.com/compassnet/

Compass.

R:0 / I:0 / P:1 [R] [G] [-]

Install SDK Platform Tools

Here I leave the instructions to install SDK Platform Tools. You'll have adb (android debug bridge) and fastboot available, so depending on the manufacturer you can unlock your bootloader, install recoveries (twrp for example) or flash custom/stock ROMs with these programs.

https://developer.android.com/studio/releases/platform-tools

1. Download SDK Platform Tools from the link above

2. $ unzip platform-tools-latest-linux.zip

3. $ sudo mv platform-tools /usr/local/

4. $ sudo chown -R root:root /usr/local/platform-tools/

5. $ cd /usr/local/bin/

6. $ sudo ln -s /usr/local/platform-tools/adb

7. $ sudo ln -s /usr/local/platform-tools/fastboot

After those commands you'll have adb and fastboot available for all users. If you want to add more binaries, just make the proper symbolic links like above.

Compass.

R:0 / I:0 / P:1 [R] [G] [-]

Android SSHD - SimpleSSHD

Ever needed to exchange files between your Android Mobile Device and your PC (for example)?

Then this thread is for you.

Install SimpleSSHD (available from Google's Play Store, F-Droid or from the developers page below). It's very easy to configure and use.

Once you're done, you'll be able to open a secure shell and exchange/sync files to and from your Android devices using ssh/scp/sftp/rsync.

One SimpleSSH is running correctly, just use your LAN/WiFi to transfer files. No more need to plugin cables all the time (less wear on the USB ports too).

Note: You can use ssh-copy-id but there's a catch. Make sure you move the file authorized_keys one directory up so it looks like the following.

From this (wrong): /data/user/0/org.galexander.sshd/files/.ssh/authorized_keys

To this (correct): /data/user/0/org.galexander.sshd/files/authorized_keys

Then you'll be able to connect without a password. It's then safe to delete the folder (/data/user/0/org.galexander.sshd/files/.ssh/). When you use ssh-copy-id the file authorized_keys is saved to a wrong directory. You then have to manually fix it as above.

Downloads: https://play.google.com/store/apps/details?id=org.galexander.sshd & https://f-droid.org/en/packages/org.galexander.sshd/

Download and Instructions: http://www.galexander.org/software/simplesshd/

Compass.

R:0 / I:0 / P:1 [R] [G] [-]

$HOME/.vimrc

From http://slackware.mirrors.tds.net/slackware/slackware-current/ChangeLog.txt :

Mon Jan 13 00:11:55 UTC 2020

a/elvis-2.2_0-i586-5.txz: Rebuilt.

Don't make /usr/bin/{ex,vi} symlinks.

a/nvi-1.81.6-i586-1.txz: Added.

This is an implementation of the classic ex/vi text editor written by Keith

Bostic. Due to this having UTF8 support which elvis lacks, we'll have it

take over the ex/vi symlinks if they aren't already pointing to a different

choice. Note that the removal of vi/ex symlinks from the elvis and vim

packages might cause your ex/vi symlinks to point to this after all the ex/vi

packages have been upgraded. You can set them to your preferences using

pkgtool -> Setup -> vi-ex.

As you can see, Elvis is being substituted by nvi.

I've done some editing with nvi to see how it goes, and from the little usage I've gotten from it, it's acceptable for simple day to day editing.

Now, if you're writing source code, beware that nvi doesn't have syntax highlighting. All you get are the colours of your terminal/console.

Since I'm learning the basics of Python programming and I make a lot of mistakes, syntax highlighting is very helpful.

Hence enter Vim. It comes standard with a Slackware 14.2 installation, and is the closest you can get to ex/vi along Elvis. Vim has syntax highlighting and is very configurable. Since Elvis seems to be walking out the door, I thought I might as well switch to Vim for coding, and perhaps use nvi for other stuff.

Below is my current $HOME/.vimrc file.

Source: https://gist.githubusercontent.com/mayela/eeca45cb841ada6019936923ce47a53d/raw/82aa079fa6d4516266e4d4ebd9034434342362c8/Python%2520highlighting%2520syntax%2520on%2520Vim

$ cat ~/.vimrc

" enable syntax highlighting

syntax on

" show line numbers

set number

" set tabs to have 4 spaces

set tabstop=4

" indent when moving to the next line while writing code

set autoindent

" expand tabs into spaces

set expandtab

" when using the >> or << commands, shift lines by 4 spaces

set shiftwidth=4

" show a visual line under the cursor's current line

set cursorline

" show the matching part of the pair for [] {} and ()

set showmatch

" enable all Python syntax highlighting features

let python_highlight_all = 1

" use a dark background

set background=dark

" don't highlight searches

set nohlsearch

set wildmenu

set showcmd

set softtabstop=4

filetype indent on

let g:ycm_python_binary_path = 'python'

let g:indent_guides_start_level = 2

let g:indent_guides_auto_colors = 1

let g:indentLine_leadingSpaceChar = '·'

let g:indentLine_leadingSpaceEnabled = 1

" Keywords {{{

"====

syn keyword pythonStatement break continue del

syn keyword pythonStatement exec return

syn keyword pythonStatement pass raise

syn keyword pythonStatement global nonlocal assert

syn keyword pythonStatement yield

syn keyword pythonLambdaExpr lambda

syn keyword pythonStatement with as

syn keyword pythonStatement def nextgroup=pythonFunction skipwhite

syn match pythonFunction "\%(\%(def\s\|@\)\s*\)\@<=\h\%(\w\|\.\)*" contained nextgroup=pythonVars

syn region pythonVars start="(" skip=+\(".*"\|'.*'\)+ end=")" contained contains=pythonParameters transparent keepend

syn match pythonParameters "[^,]*" contained contains=pythonParam skipwhite

syn match pythonParam "[^,]*" contained contains=pythonExtraOperator,pythonLambdaExpr,pythonBuiltinObj,pythonBuiltinType,pythonConstant,pythonString,pythonNumber,pythonBrackets,pythonSelf,pythonComment skipwhite

syn match pythonBrackets "{[(|)]}" contained skipwhite

syn keyword pythonStatement class nextgroup=pythonClass skipwhite

syn match pythonClass "\%(\%(class\s\)\s*\)\@<=\h\%(\w\|\.\)*" contained nextgroup=pythonClassVars

syn region pythonClassVars start="(" end=")" contained contains=pythonClassParameters transparent keepend

syn match pythonClassParameters "[^,\*]*" contained contains=pythonBuiltin,pythonBuiltinObj,pythonBuiltinType,pythonExtraOperatorpythonStatement,pythonBrackets,pythonString,pythonComment skipwhite

syn keyword pythonRepeat for while

syn keyword pythonConditional if elif else

syn keyword pythonInclude import from

syn keyword pythonException try except finally

syn keyword pythonOperator and in is not or

syn match pythonExtraOperator "\%([~!^&|/%+-]\|\%(class\s*\)\@<!<<\|<=>\|<=\|\%(<\|\<class\s\+\u\w*\s*\)\@<!<[^<]\@=\=\|\|=\~\|>>\|>=\|=\@<!>\|\.\.\.\|\.\.\|::\)"

syn match pythonExtraPseudoOperator "\%(-=\|/=\|\*\*=\|\*=\|&&=\|&=\|&&\|||=\||=\|||\|%=\|+=\|!\~\|!=\)"

syn keyword pythonStatement print

syn keyword pythonStatement async await

syn match pythonStatement "\<async\s\+def\>" nextgroup=pythonFunction skipwhite

syn match pythonStatement "\<async\s\+with\>" display

syn match pythonStatement "\<async\s\+for\>" nextgroup=pythonRepeat skipwhite

syn match pythonExtraOperator "\%(=\)"

syn match pythonExtraOperator "\%(\*\|\*\*\)"

syn keyword pythonSelf self cls

" }}}

" Decorators {{{

"======

syn match pythonDecorator "@" display nextgroup=pythonDottedName skipwhite

syn match pythonDottedName "[a-zA-Z_][a-zA-Z0-9_]*\(\.[a-zA-Z_][a-zA-Z0-9_]*\)*" display contained

syn match pythonDot "\." display containedin=pythonDottedName

" }}}

" Comments {{{

"====

syn match pythonComment "#.*$" display contains=pythonTodo,@Spell

syn match pythonRun "\%^#!.*$"

syn match pythonCoding "\%^.*\(\n.*\)\?#.*coding[:=]\s*[0-9A-Za-z-_.]\+.*$"

syn keyword pythonTodo TODO FIXME XXX contained

" }}}

" Errors {{{

"==

syn match pythonError "\<\d\+\D\+\>" display

syn match pythonError "[$?]" display

syn match pythonError "[&|]\{2,}" display

syn match pythonError "[=]\{3,}" display

syn match pythonIndentError "^\s*\( \t\|\t \)\s*\S"me=e-1 display

syn match pythonSpaceError "\s\+$" display

" Strings {{{

"===

syn region pythonString start=+[bB]\='+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonEscape,pythonEscapeError,@Spell

syn region pythonString start=+[bB]\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonEscape,pythonEscapeError,@Spell

syn region pythonString start=+[bB]\="""+ end=+"""+ keepend contains=pythonEscape,pythonEscapeError,pythonDocTest2,pythonSpaceError,@Spell

syn region pythonString start=+[bB]\=+ end=++ keepend contains=pythonEscape,pythonEscapeError,pythonDocTest,pythonSpaceError,@Spell

syn match pythonEscape +\\[abfnrtv'"\\]+ display contained

syn match pythonEscape "\\\o\o\=\o\=" display contained

syn match pythonEscapeError "\\\o\{,2}[89]" display contained

syn match pythonEscape "\\x\x\{2}" display contained

syn match pythonEscapeError "\\x\x\=\X" display contained

syn match pythonEscape "\\$"

" Unicode

syn region pythonUniString start=+[uU]'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonEscape,pythonUniEscape,pythonEscapeError,pythonUniEscapeError,@Spell

syn region pythonUniString start=+[uU]"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonEscape,pythonUniEscape,pythonEscapeError,pythonUniEscapeError,@Spell

syn region pythonUniString start=+[uU]"""+ end=+"""+ keepend contains=pythonEscape,pythonUniEscape,pythonEscapeError,pythonUniEscapeError,pythonDocTest2,pythonSpaceError,@Spell

syn region pythonUniString start=+[uU]+ end=++ keepend contains=pythonEscape,pythonUniEscape,pythonEscapeError,pythonUniEscapeError,pythonDocTest,pythonSpaceError,@Spell

syn match pythonUniEscape "\\u\x\{4}" display contained

syn match pythonUniEscapeError "\\u\x\{,3}\X" display contained

syn match pythonUniEscape "\\U\x\{8}" display contained

syn match pythonUniEscapeError "\\U\x\{,7}\X" display contained

syn match pythonUniEscape "\\N{[A-Z ]\+}" display contained

syn match pythonUniEscapeError "\\N{[^A-Z ]\+}" display contained

" Raw strings

syn region pythonRawString start=+[rR]'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonRawEscape,@Spell

syn region pythonRawString start=+[rR]"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonRawEscape,@Spell

syn region pythonRawString start=+[rR]"""+ end=+"""+ keepend contains=pythonDocTest2,pythonSpaceError,@Spell

syn region pythonRawString start=+[rR]+ end=++ keepend contains=pythonDocTest,pythonSpaceError,@Spell

syn match pythonRawEscape +\\['"]+ display transparent contained

" Unicode raw strings

syn region pythonUniRawString start=+[uU][rR]'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonRawEscape,pythonUniRawEscape,pythonUniRawEscapeError,@Spell

syn region pythonUniRawString start=+[uU][rR]"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonRawEscape,pythonUniRawEscape,pythonUniRawEscapeError,@Spell

syn region pythonUniRawString start=+[uU][rR]"""+ end=+"""+ keepend contains=pythonUniRawEscape,pythonUniRawEscapeError,pythonDocTest2,pythonSpaceError,@Spell

syn region pythonUniRawString start=+[uU][rR]+ end=++ keepend contains=pythonUniRawEscape,pythonUniRawEscapeError,pythonDocTest,pythonSpaceError,@Spell

syn match pythonUniRawEscape "\([^\\]\(\\\\\)*\)\@<=\\u\x\{4}" display contained

syn match pythonUniRawEscapeError "\([^\\]\(\\\\\)*\)\@<=\\u\x\{,3}\X" display contained

" String formatting

syn match pythonStrFormatting "%\(([^)]\+)\)\=[-#0 +]*\d*\(\.\d\+\)\=[hlL]\=[diouxXeEfFgGcrs%]" contained containedin=pythonString,pythonUniString,pythonRawString,pythonUniRawString

syn match pythonStrFormatting "%[-#0 +]*\(\*\|\d\+\)\=\(\.\(\*\|\d\+\)\)\=[hlL]\=[diouxXeEfFgGcrs%]" contained containedin=pythonString,pythonUniString,pythonRawString,pythonUniRawString

" Str.format syntax

syn match pythonStrFormat "{{\|}}" contained containedin=pythonString,pythonUniString,pythonRawString,pythonUniRawString

syn match pythonStrFormat "{\([a-zA-Z0-9_]*\|\d\+\)\(\.[a-zA-Z_][a-zA-Z0-9_]*\|\[\(\d\+\|[^!:\}]\+\)\]\)*\(![rs]\)\=\(:\({\([a-zA-Z_][a-zA-Z0-9_]*\|\d\+\)}\|\([^}]\=[<>=^]\)\=[ +-]\=#\=0\=\d*\(\.\d\+\)\=[bcdeEfFgGnoxX%]\=\)\=\)\=}" contained containedin=pythonString,pythonUniString,pythonRawString,pythonUniRawString

" String templates

syn match pythonStrTemplate "\$\$" contained containedin=pythonString,pythonUniString,pythonRawString,pythonUniRawString

syn match pythonStrTemplate "\${[a-zA-Z_][a-zA-Z0-9_]*}" contained containedin=pythonString,pythonUniString,pythonRawString,pythonUniRawString

syn match pythonStrTemplate "\$[a-zA-Z_][a-zA-Z0-9_]*" contained containedin=pythonString,pythonUniString,pythonRawString,pythonUniRawString

" DocTests

syn region pythonDocTest start="^\s*>>>" end=+'''+he=s-1 end="^\s*$" contained

syn region pythonDocTest2 start="^\s*>>>" end=+"""+he=s-1 end="^\s*$" contained

" DocStrings

syn region pythonDocstring start=+^\s*[uU]\?[rR]\?"""+ end=+"""+ keepend excludenl contains=pythonEscape,@Spell,pythonDoctest,pythonDocTest2,pythonSpaceError

syn region pythonDocstring start=+^\s*[uU]\?[rR]\?+ end=++ keepend excludenl contains=pythonEscape,@Spell,pythonDoctest,pythonDocTest2,pythonSpaceError

" }}}

" Numbers {{{

"===

syn match pythonHexError "\<0[xX]\x*[g-zG-Z]\x*[lL]\=\>" display

syn match pythonHexNumber "\<0[xX]\x\+[lL]\=\>" display

syn match pythonOctNumber "\<0[oO]\o\+[lL]\=\>" display

syn match pythonBinNumber "\<0[bB][01]\+[lL]\=\>" display

syn match pythonNumber "\<\d\+[lLjJ]\=\>" display

syn match pythonFloat "\.\d\+\([eE][+-]\=\d\+\)\=[jJ]\=\>" display

syn match pythonFloat "\<\d\+[eE][+-]\=\d\+[jJ]\=\>" display

syn match pythonFloat "\<\d\+\.\d*\([eE][+-]\=\d\+\)\=[jJ]\=" display

syn match pythonOctError "\<0[oO]\=\o*[8-9]\d*[lL]\=\>" display

syn match pythonBinError "\<0[bB][01]*[2-9]\d*[lL]\=\>" display

" }}}

" Builtins {{{

"====

" Builtin objects and types

syn keyword pythonBuiltinObj True False Ellipsis None NotImplemented

syn keyword pythonBuiltinObj debug doc file name package

syn keyword pythonBuiltinType type object

syn keyword pythonBuiltinType str basestring unicode buffer bytearray bytes chr unichr

syn keyword pythonBuiltinType dict int long bool float complex set frozenset list tuple

syn keyword pythonBuiltinType file super

" Builtin functions

syn keyword pythonBuiltinFunc import abs all any apply

syn keyword pythonBuiltinFunc bin callable classmethod cmp coerce compile

syn keyword pythonBuiltinFunc delattr dir divmod enumerate eval execfile filter

syn keyword pythonBuiltinFunc format getattr globals locals hasattr hash help hex id

syn keyword pythonBuiltinFunc input intern isinstance issubclass iter len map max min

syn keyword pythonBuiltinFunc next oct open ord pow property range xrange

syn keyword pythonBuiltinFunc raw_input reduce reload repr reversed round setattr

syn keyword pythonBuiltinFunc slice sorted staticmethod sum vars zip

syn keyword pythonBuiltinFunc print

" Builtin exceptions and warnings

syn keyword pythonExClass BaseException

syn keyword pythonExClass Exception StandardError ArithmeticError

syn keyword pythonExClass LookupError EnvironmentError

syn keyword pythonExClass AssertionError AttributeError BufferError EOFError

syn keyword pythonExClass FloatingPointError GeneratorExit IOError

syn keyword pythonExClass ImportError IndexError KeyError

syn keyword pythonExClass KeyboardInterrupt MemoryError NameError

syn keyword pythonExClass NotImplementedError OSError OverflowError

syn keyword pythonExClass ReferenceError RuntimeError StopIteration

syn keyword pythonExClass SyntaxError IndentationError TabError

syn keyword pythonExClass SystemError SystemExit TypeError

syn keyword pythonExClass UnboundLocalError UnicodeError

syn keyword pythonExClass UnicodeEncodeError UnicodeDecodeError

syn keyword pythonExClass UnicodeTranslateError ValueError VMSError

syn keyword pythonExClass WindowsError ZeroDivisionError

syn keyword pythonExClass Warning UserWarning BytesWarning DeprecationWarning

syn keyword pythonExClass PendingDepricationWarning SyntaxWarning

syn keyword pythonExClass RuntimeWarning FutureWarning

syn keyword pythonExClass ImportWarning UnicodeWarning

" }}}

" Enhanced python highlighting

highlight pythonLambdaExpr ctermfg=105 guifg=#8787ff

highlight pythonInclude ctermfg=68 guifg=#5f87d7 cterm=bold gui=bold

highlight pythonClass ctermfg=167 guifg=#FF62B0 cterm=bold gui=bold

highlight pythonParameters ctermfg=147 guifg=#AAAAFF

highlight pythonParam ctermfg=175 guifg=#E37795

highlight pythonBrackets ctermfg=183 guifg=#d7afff

highlight pythonClassParameters ctermfg=111 guifg=#FF5353

highlight pythonSelf ctermfg=68 guifg=#5f87d7 cterm=bold gui=bold

highlight pythonDottedName ctermfg=74 guifg=#5fafd7

highlight pythonError ctermfg=196 guifg=#ff0000

highlight pythonIndentError ctermfg=197 guifg=#ff005f

highlight pythonSpaceError ctermfg=198 guifg=#ff0087

highlight pythonBuiltinType ctermfg=74 guifg=#9191FF

highlight pythonBuiltinObj ctermfg=71 guifg=#5faf5f

highlight pythonBuiltinFunc ctermfg=169 guifg=#d75faf cterm=bold gui=bold

highlight pythonException ctermfg=207 guifg=#CC3366 cterm=bold gui=bold

R:0 / I:0 / P:1 [R] [G] [-]

Slackware Alternative Repositories

There are many alternative repositories for Slackware, and here I will post the ones that I currently know of.

https://slackbuilds.org/ (not a repository, but a collection of build scripts)

https://slackware.pkgs.org/

https://packages.slackonly.com/

https://slackware.nl/ - https://alien.slackbook.org/blog/ - http://www.slackware.com/~alien/slackbuilds/

R:0 / I:0 / P:1 [R] [G] [-]

Install Setup Scripts (after an install)

If you ever have the need to run the setup scripts after you're done installing, look in /var/log/setup/.

For example, by running setup.80.make-bootdisk you can make a USB Linux boot stick. Such a boot stick is helpful in some situations, like when you forget to run lilo after updating your linux kernel and the computer won't boot. Of course you can also use the installation media to fix the same issue.

There is important information inside setup.80.make-bootdisk, so make sure to read it. The script will erase the USB stick. You have been warned.

$ less /var/log/setup/setup.80.make-bootdisk

or my favourite

$ most /var/log/setup/setup.80.make-bootdisk

Run them using sudo or root. All of them have prompts, so no changes will be done right away.

Compass.

R:0 / I:0 / P:1 [R] [G] [-]

Command line interface for testing internet bandwidth using speedtest.net

It's possible to test your internet speed using only the command line instead of the web version of speedtest.net.

https://github.com/sivel/speedtest-cli

1. Download speedtest-cli (speedtest-cli works with Python 2.4-3.7):

$ curl -Lo speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py

2. Move speedtest.py to /usr/local/bin/ and correct the permissions (I'm assuming that's where you want to install it):

$ sudo mv speedtest.py /usr/local/bin/speedtest && sudo chmod 755 /usr/local/bin/speedtest && sudo chown root:root /usr/local/bin/speedtest

3. Read the speedtest-cli help:

$ speedtest -h

If you need to know the specific servers that speedtest.net uses, go to: http://c.speedtest.net/speedtest-servers-static.php

And if you want the ip address of any server, use dig (or nslookup) like this: $ dig speed-server.speedtest.net

Compass.

R:0 / I:0 / P:1 [R] [G] [-]

Blocking Spam Hosts

If you want to block spam hosts from bothering you, one solution is to use a Blocklist combined with /etc/hosts.

Searching around the internet you can find various free Blocklists, but one of the best is https://pgl.yoyo.org/adservers/.

1. Go to https://pgl.yoyo.org/adservers/ with your web browser.

2. In "list ad server hostnames:" select "hosts – in hosts file format" and "view list as plain text:", then click on "go". Save the list (for example spamhosts.txt).

3. Then as root append spamhosts.txt to /etc/hosts:

# cat spamhosts.txt >> /etc/hosts

This command will add spamhosts.txt to the end of your current /etc/hosts, but if you're worried make a backup before you run the command above.

4. There is no need to restart your browser or computer after saving /etc/hosts.

The Blocklist will make requests for the spam hosts to go to localhost (127.0.0.1), which means your computer will translate the host to 127.0.0.1 (just like a DNS Server would). Since 127.0.0.1 is just localhost (your computer with no http server to pull content from), nothing will happen.

Just in case you want to know what my /etc/hosts looks like (I changed the local machine hosts of course), here's a snippet blow:

#
# hosts This file describes a number of hostname-to-address
# mappings for the TCP/IP subsystem. It is mostly
# used at boot time, when no name servers are running.
# On small systems, this file can be used instead of a
# "named" name server. Just add the names, addresses
# and any aliases to this file...
#
# By the way, Arnt Gulbrandsen <agulbra@nvg.unit.no> says that 127.0.0.1
# should NEVER be named with the name of the machine. It causes problems
# for some (stupid) programs, irc and reputedly talk. :^)
#

# For loopbacking.
127.0.0.1 localhost
192.168.100.1 a
192.168.0.1 b
192.168.0.2 c
192.168.0.3 d
192.168.0.4 e

# Blocklist for use with hosts files to block ads
#
# For more information about this list, see: https://pgl.yoyo.org/adservers/
# ----
# last updated: Fri, 15 Mar 2019 14:46:10 GMT
# entries: 2950
# format: hosts (hosts -- in hosts file format)
# credits: Peter Lowe - pgl@yoyo.org - https://pgl.yoyo.org/ - https://twitter.com/pgl
# this URL: https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=1
# Patreon: https://patreon.com/blocklist
# other formats: https://pgl.yoyo.org/adservers/formats.php
# policy: https://pgl.yoyo.org/adservers/policy.php
#
# start date: Mon, 22 Mar 1999 00:00:00
127.0.0.1 101com.com
127.0.0.1 101order.com
127.0.0.1 123found.com
127.0.0.1 123freeavatars.com
127.0.0.1 180hits.de
127.0.0.1 180searchassistant.com
127.0.0.1 207.net
127.0.0.1 247media.com
127.0.0.1 24log.com
127.0.0.1 24log.de
127.0.0.1 24pm-affiliation.com
127.0.0.1 2mdn.net
127.0.0.1 2o7.net
127.0.0.1 2znp09oa.com
127.0.0.1 33across.com
127.0.0.1 360yield.com
127.0.0.1 3lift.com
127.0.0.1 4affiliate.net
127.0.0.1 4d5.net
127.0.0.1 4info.com
127.0.0.1 4jnzhl0d0.com
127.0.0.1 50websads.com
127.0.0.1 518ad.com
127.0.0.1 51yes.com
127.0.0.1 5mcwl.pw
127.0.0.1 600z.com
127.0.0.1 6ldu6qa.com
127.0.0.1 777partner.com
127.0.0.1 77tracking.com
127.0.0.1 7bpeople.com
127.0.0.1 7search.com
127.0.0.1 82o9v830.com
...

R:1 / I:0 / P:1 [R] [G] [-]

.screenrc

This is the .screenrc I currently use for GNU Screen.

With it you can change windows by using the Function Keys on your keyboard (F1, F2 and so on).

To use it, just place the file in your $HOME and you're set. If you already have a $HOME/.screenrc, make a backup first just in case.

The screenshot differs from the .screenrc by the way.

#
# This is an example for the global screenrc file.
# You may want to install this file as /etc/screenrc.
# Check config.h for the exact location.
#
# Flaws of termcap and standard settings are done here.
#

#startup_message off

#defflow on # will force screen to process ^S/^Q

deflogin on
#autodetach off

#vbell on
#vbell_msg " Wuff ---- Wuff!! "

# all termcap entries are now duplicated as terminfo entries.
# only difference should be the slightly modified syntax, and check for
# terminfo entries, that are already corected in the database.
#
# G0 we have a SEMI-GRAPHICS-CHARACTER-MODE
# WS this sequence resizes our window.
# cs this sequence changes the scrollregion
# hs@ we have no hardware statusline. screen will only believe that
# there is a hardware status line if hs,ts,fs,ds are all set.
# ts to statusline
# fs from statusline
# ds delete statusline
# al add one line
# AL add multiple lines
# dl delete one line
# DL delete multiple lines
# ic insert one char (space)
# IC insert multiple chars
# nx terminal uses xon/xoff

termcap facit|vt100|xterm LP:G0
terminfo facit|vt100|xterm LP:G0

#the vt100 description does not mention "dl". *sigh*
termcap vt100 dl=5\E[M
terminfo vt100 dl=5\E[M

#facit's "al" / "dl" are buggy if the current / last line
#contain attributes...
termcap facit al=\E[L\E[K:AL@:dl@:DL@:cs=\E[%i%d;%dr:ic@
terminfo facit al=\E[L\E[K:AL@:dl@:DL@:cs=\E[%i%p1%d;%p2%dr:ic@

#make sun termcap/info better
termcap sun 'up=^K:AL=\E[%dL:DL=\E[%dM:UP=\E[%dA:DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:IC=\E[%d@:WS=1000\E[8;%d;%dt'
terminfo sun 'up=^K:AL=\E[%p1%dL:DL=\E[%p1%dM:UP=\E[%p1%dA:DO=\E[%p1%dB:LE=\E[%p1%dD:RI=\E[%p1%dC:IC=\E[%p1%d@:WS=\E[8;%p1%d;%p2%dt$<1000>'

#xterm understands both im/ic and doesn't have a status line.
#Note: Do not specify im and ic in the real termcap/info file as
#some programs (e.g. vi) will (no,no, may (jw)) not work anymore.
termcap xterm|fptwist hs@:cs=\E[%i%d;%dr:im=\E[4h:ei=\E[4l
terminfo xterm|fptwist hs@:cs=\E[%i%p1%d;%p2%dr:im=\E[4h:ei=\E[4l

# Long time I had this in my private screenrc file. But many people
# seem to want it (jw):
# we do not want the width to change to 80 characters on startup:
# on suns, /etc/termcap has :is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l:
termcap xterm 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l'
terminfo xterm 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l'

#
# Do not use xterms alternate window buffer.
# This one would not add lines to the scrollback buffer.
#termcap xterm|xterms|xs ti=\E7\E[?47l
#terminfo xterm|xterms|xs ti=\E7\E[?47l

#make hp700 termcap/info better
termcap hp700 'Z0=\E[?3h:Z1=\E[?3l:hs:ts=\E[62"p\E[0$~\E[2$~\E[1$}:fs=\E[0}\E[61"p:ds=\E[62"p\E[1$~\E[61"p:ic@'
terminfo hp700 'Z0=\E[?3h:Z1=\E[?3l:hs:ts=\E[62"p\E[0$~\E[2$~\E[1$}:fs=\E[0}\E[61"p:ds=\E[62"p\E[1$~\E[61"p:ic@'

#wyse-75-42 must have defflow control (xo = "terminal uses xon/xoff")
#(nowadays: nx = padding doesn't work, have to use xon/off)
#essential to have it here, as this is a slow terminal.
termcap wy75-42 nx:xo:Z0=\E[?3h\E[31h:Z1=\E[?3l\E[31h
terminfo wy75-42 nx:xo:Z0=\E[?3h\E[31h:Z1=\E[?3l\E[31h

#remove some stupid / dangerous key bindings
bind ^k
#bind L
bind ^\
#make them better
bind \\ quit
bind K kill
bind I login on
bind O login off
bind } history

# Various (un)used settings:
termcapinfo xterm*|rxvt* 'ti@:te@'
#term xterm-256color
#term linux
#export TERM=xterm

# This is how one can set a reattach password:
# C-a :password (this means ctrl+a, :password; you'll be prompted twice for the password) then paste the encrypted password below, uncomment and save.
#password KCv2pnkjw79i6

# Disable the visible bell (screen flashing):
vbell off

# Detach when screen hangs up:
autodetach on

# Don't display the copyright page:
startup_message off

# Set the scrollback buffer to 4096 lines:
defscrollback 4096

# Configure terminfo, termcap and allow bold colours, for a nice 256 color terminal:
attrcolor b ".I"

# Configure screen to set colours. AB = background. AF=foreground:
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'

# Erase the background with current bg colour:
defbce "on"

# Do not remove a window once its process terminates (k/kill; r/restore). The window is removed if the process exits normally ('0'):
zombie kr onerror

# Unset the display variable so programs that require the DISPLAY variable start faster, since we are in a terminal. X programs will not run. If this is set, xset/xrandr/etc will not work:
#unsetenv DISPLAY

# Configure the hardstatusline:
#hardstatus alwayslastline '[%{k}compass%{d}] ;� %l %d/%m %c %-w%{= KW}%n%f* %t%{-}%+w'
#hardstatus alwayslastline '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m-%d %{W} %c %{g}]'
#hardstatus alwayslastline '%{= G}[ %{G}%H %{g}][%= %{= w}%?%-Lw%?%{= R}%n*%f %t%?%{= R}(%u)%?%{= w}%+Lw%?%= %{= g}][ %{y}Load: %l %{g}][%{B}%Y-%m-%d %{W}%c:%s %{g}]'
#hardstatus alwayslastline '[%{k}compass%{d}] ;� %d/%m %c %-w%{= KW}%n* %t%{-}%+w'
#hardstatus alwayslastline '[%H] ;� %d/%m/%Y%C%A %l %-w%{= kw}%n* %t%{-}%+w'
#hardstatus alwayslastline '[%H] ;� %d/%m/%Y%C%A %D %l %-w%{= kw}%n* %t%{-}%+w'
#hardstatus alwayslastline '%H %{wb} %c:%s | %d.%m.%Y %{wr} Load: %l %{wk} %w'
#hardstatus alwayslastline '[%H] ;� %d/%m/%Y %C%A %D %-w%{= kw}%n* %t%{-}%+w'
hardstatus alwayslastline '[%H] %d/%m/%Y %C%A %D %-w%{= kw}%n* %t%{-}%+w'

# Configure the names for each window:
screen -t Star2 12
screen -t Star1 11
screen -t Term3 10
screen -t Term2 9
screen -t Term1 8
#screen -t ss 7 sh -c 'watch -n 5 '\''/usr/sbin/ss -tapn | grep -e firefox -e qbittorrent -e palemoon | sort -h'\''; exec bash -i'
screen -t ss 7 sh -c 'watch -n 5 '\''/usr/sbin/ss -utapn | sort -h'\''; exec bash -i'
screen -t htop 6 sh -c 'htop -u net -d 50; exec bash -i'
screen -t alsamixer 5 sh -c 'export TERM=linux; alsamixer -c 1; exec bash -i'
screen -t music 4 sh -c 'cd /home/net/music/; exec bash -i'
screen -t irc2 3
screen -t irc1 2
screen -t links 1 sh -c 'links '\''http://slackware.mirrors.tds.net/pub/slackware/slackware/ChangeLog.txt'\''; exec bash -i'

# Configure the Function (F#) keys to switch between windows:
bindkey -k k1 select 1
bindkey -k k2 select 2
bindkey -k k3 select 3
bindkey -k k4 select 4
bindkey -k k5 select 5
bindkey -k k6 select 6
bindkey -k k7 select 7
bindkey -k k8 select 8
bindkey -k k9 select 9
bindkey -k k; select 10
bindkey -k F1 select 11
bindkey -k F2 select 12

R:0 / I:0 / P:2 [R] [G] [-]

BIND + VPN Killswitch Fix

If you've used my IPTables VPN Killswitch thread together with the Local Caching Name Server thread, you'll likely be unable to connect or reconnect to your VPN Provider Servers.

That's because IPTables will interfere with BIND (basically it won't be able to resolve your VPN's hosts), but there is a fix.

BETWEEN THIS RED TEXT, CONSIDER THIS WORK IN PROGRESS!

$ cat /etc/named.conf

options {

directory "/var/named";

/*

* If there is a firewall between you and nameservers you want

* to talk to, you might need to uncomment the query-source

* directive below. Previous versions of BIND always asked

* questions using port 53, but BIND 8.1 uses an unprivileged

* port by default.

*/

// query-source address * port 53;

So what you need to do is this. And by the way, at this point the VPN Killswitch should be active and OpenVPN inactive (disabled).

1. Stop BIND:

# cd /etc/rc.d/

# ./rc.bind stop (you can use status instead of stop if you want to verify the current state)

2. Uncomment (remove the /'s) from the line "// query-source address * port 53;" in /etc/named.conf, so it looks like this "query-source address * port 53;". You can also leave the original line and just paste an uncommented copy right below like I did (check this threads image).

# vi /etc/named.conf (or use your favourite text editor)

3. Start BIND:

# cd /etc/rc.d/

# ./rc.bind start

4. Start OpenVPN:

# /etc/rc.d/rc.openvpn start /path/to/some/other/configfile.conf (read /etc/rc.d/rc.openvpn for more instructions)

You should now be able to connect to your VPN Servers normally (your local BIND server should be able to resolve the host names).

BETWEEN THIS RED TEXT, CONSIDER THIS WORK IN PROGRESS!

When the VPN goes down, there are still issues with the method above. I'll try to explain the problem the best I can. My IPTables VPN Killswitch is very restrictive, so much so that I have to start BIND, OpenVPN, sleep 10 seconds (less than 10s might work but it needs testing) and only then start the IPTables VPN Killswitch. If I start the IPTables VPN Killswitch first, BIND won't work and so OpenVPN cannot find the VPN servers. Now I know you might argue that it's unsafe to not have the IPTables VPN Killswitch running first, but if BIND doesn't work then OpenVPN will fail to connect. Below is the current order of commands that I'm doing. Hopefully I won't have to change it anymore.

Start BIND, OpenVPN and the IPTables VPN Killswitch (in order): # sh /etc/rc.d/rc.bind start && sh /etc/rc.d/rc.openvpn start /etc/openvpn/vpnconfig.conf && sleep 10s && sh /etc/rc.d/rc.firewall

Flush the IPTables VPN Killswitch, flush all the routes (so when you run /etc/rc.d/rc.firewall it won't complain about NETLINK), stop OpenVPN and then stop BIND (in order): # iptables -F && iptables -P INPUT ACCEPT && iptables -P FORWARD ACCEPT && iptables -P OUTPUT ACCEPT && ip route flush all && sh /etc/rc.d/rc.openvpn stop && sh /etc/rc.d/rc.bind stop

Also the line "// query-source address * port 53;" should be left as it is (do not remove the //'s). Since /etc/rc.d/rc.firewall is run last, uncommenting is unnecessary and apparently named won't work if you do so.

I've used some of the DNS Leak Tests below, and no DNS leaks were detected.

Once this situation is stable, I'll do a cleanup of this thread.I apologize if you tried this and had issues, but then so did I.

If you want to test your local DNS Server, there are plenty of online DNS Leak Tests available. Below are some for you to try.

http://dnsleak.com/

https://www.dnsleaktest.com/

https://tenta.com/test/

https://ipleak.org/

http://www.doileak.com/

http://cryptoip.info/

https://browserleaks.com/

https://hidester.com/dns-leak-test/

R:0 / I:0 / P:2 [R] [G] [-]

Verifying terminal colours

These are two perl scripts I use to verify if my terminal emulator program (XTerm) is displaying colours properly.

Save one (or both) to /usr/local/bin and "chmod 755" them. No need to leave the .pl at the end.

256colours:

#!/usr/bin/perl
# Author: Todd Larason <jtl@molehill.org>
# $XFree86: xc/programs/xterm/vttests/256colors2.pl,v 1.2 2002/03/26 01:46:43 dickey Exp $

# use the resources for colors 0-15 - usually more-or-less a
# reproduction of the standard ANSI colors, but possibly more
# pleasing shades

# colors 16-231 are a 6x6x6 color cube
for ($red = 0; $red < 6; $red++) {
for ($green = 0; $green < 6; $green++) {
for ($blue = 0; $blue < 6; $blue++) {
printf("\x1b]4;%d;rgb:%2.2x/%2.2x/%2.2x\x1b\\",
16 + ($red * 36) + ($green * 6) + $blue,
($red ? ($red * 40 + 55) : 0),
($green ? ($green * 40 + 55) : 0),
($blue ? ($blue * 40 + 55) : 0));
}
}
}

# colors 232-255 are a grayscale ramp, intentionally leaving out
# black and white
for ($gray = 0; $gray < 24; $gray++) {
$level = ($gray * 10) + 8;
printf("\x1b]4;%d;rgb:%2.2x/%2.2x/%2.2x\x1b\\",
232 + $gray, $level, $level, $level);
}


# display the colors

# first the system ones:
print "System colors:\n";
for ($color = 0; $color < 8; $color++) {
print "\x1b[48;5;${color}m ";
}
print "\x1b[0m\n";
for ($color = 8; $color < 16; $color++) {
print "\x1b[48;5;${color}m ";
}
print "\x1b[0m\n\n";

# now the color cube
print "Color cube, 6x6x6:\n";
for ($green = 0; $green < 6; $green++) {
for ($red = 0; $red < 6; $red++) {
for ($blue = 0; $blue < 6; $blue++) {
$color = 16 + ($red * 36) + ($green * 6) + $blue;
print "\x1b[48;5;${color}m ";
}
print "\x1b[0m ";
}
print "\n";
}


# now the grayscale ramp
print "Grayscale ramp:\n";
for ($color = 232; $color < 256; $color++) {
print "\x1b[48;5;${color}m ";
}
print "\x1b[0m\n";

colours:

#!/usr/bin/perl

# by entheon, do whatever the hell you want with this file

print "\n";
print "**************************\n";
print "*XTERM 256Color Test Chart\n";
print "**************************\n";
print "* 16 = black\n";
print "* 255 = white\n";
print "*\n";
print "* Usage:\n";
print "* colortest -w\n";
print "* wide display\n";
print "*\n";
print "* colortest -w -r\n";
print "* wide display reversed\n";
print "*\n";
print "* colortest -w -s\n";
print "* extra spaces padding\n";
print "*\n";
print "* colortest -w -r -s\n";
print "* available combination\n";
print "*\n";
print "**************************\n";

if( $ARGV[0] eq "-w" || $ARGV[1] eq "-w" || $ARGV[2] eq "-w" ) {
push(@arr, [( "#[38;5;16m 16: 00/00/00", "#[38;5;17m 17: 00/00/5f", "#[38;5;18m 18: 00/00/87", "#[38;5;19m 19: 00/00/af", "#[38;5;20m 20: 00/00/d7", "#[38;5;21m 21: 00/00/ff")] );
push(@arr, [( "#[38;5;22m 22: 00/5f/00", "#[38;5;23m 23: 00/5f/5f", "#[38;5;24m 24: 00/5f/87", "#[38;5;25m 25: 00/5f/af", "#[38;5;26m 26: 00/5f/d7", "#[38;5;27m 27: 00/5f/ff")] );
push(@arr, [( "#[38;5;28m 28: 00/87/00", "#[38;5;29m 29: 00/87/5f", "#[38;5;30m 30: 00/87/87", "#[38;5;31m 31: 00/87/af", "#[38;5;32m 32: 00/87/d7", "#[38;5;33m 33: 00/87/ff")] );
push(@arr, [( "#[38;5;34m 34: 00/af/00", "#[38;5;35m 35: 00/af/5f", "#[38;5;36m 36: 00/af/87", "#[38;5;37m 37: 00/af/af", "#[38;5;38m 38: 00/af/d7", "#[38;5;39m 39: 00/af/ff")] );
push(@arr, [( "#[38;5;40m 40: 00/d7/00", "#[38;5;41m 41: 00/d7/5f", "#[38;5;42m 42: 00/d7/87", "#[38;5;43m 43: 00/d7/af", "#[38;5;44m 44: 00/d7/d7", "#[38;5;45m 45: 00/d7/ff")] );
push(@arr, [( "#[38;5;46m 46: 00/ff/00", "#[38;5;47m 47: 00/ff/5f", "#[38;5;48m 48: 00/ff/87", "#[38;5;49m 49: 00/ff/af", "#[38;5;50m 50: 00/ff/d7", "#[38;5;51m 51: 00/ff/ff")] );
push(@arr, [( "#[38;5;52m 52: 5f/00/00", "#[38;5;53m 53: 5f/00/5f", "#[38;5;54m 54: 5f/00/87", "#[38;5;55m 55: 5f/00/af", "#[38;5;56m 56: 5f/00/d7", "#[38;5;57m 57: 5f/00/ff")] );
push(@arr, [( "#[38;5;58m 58: 5f/5f/00", "#[38;5;59m 59: 5f/5f/5f", "#[38;5;60m 60: 5f/5f/87", "#[38;5;61m 61: 5f/5f/af", "#[38;5;62m 62: 5f/5f/d7", "#[38;5;63m 63: 5f/5f/ff")] );
push(@arr, [( "#[38;5;64m 64: 5f/87/00", "#[38;5;65m 65: 5f/87/5f", "#[38;5;66m 66: 5f/87/87", "#[38;5;67m 67: 5f/87/af", "#[38;5;68m 68: 5f/87/d7", "#[38;5;69m 69: 5f/87/ff")] );
push(@arr, [( "#[38;5;70m 70: 5f/af/00", "#[38;5;71m 71: 5f/af/5f", "#[38;5;72m 72: 5f/af/87", "#[38;5;73m 73: 5f/af/af", "#[38;5;74m 74: 5f/af/d7", "#[38;5;75m 75: 5f/af/ff")] );
push(@arr, [( "#[38;5;76m 76: 5f/d7/00", "#[38;5;77m 77: 5f/d7/5f", "#[38;5;78m 78: 5f/d7/87", "#[38;5;79m 79: 5f/d7/af", "#[38;5;80m 80: 5f/d7/d7", "#[38;5;81m 81: 5f/d7/ff")] );
push(@arr, [( "#[38;5;82m 82: 5f/ff/00", "#[38;5;83m 83: 5f/ff/5f", "#[38;5;84m 84: 5f/ff/87", "#[38;5;85m 85: 5f/ff/af", "#[38;5;86m 86: 5f/ff/d7", "#[38;5;87m 87: 5f/ff/ff")] );
push(@arr, [( "#[38;5;88m 88: 87/00/00", "#[38;5;89m 89: 87/00/5f", "#[38;5;90m 90: 87/00/87", "#[38;5;91m 91: 87/00/af", "#[38;5;92m 92: 87/00/d7", "#[38;5;93m 93: 87/00/ff")] );
push(@arr, [( "#[38;5;94m 94: 87/5f/00", "#[38;5;95m 95: 87/5f/5f", "#[38;5;96m 96: 87/5f/87", "#[38;5;97m 97: 87/5f/af", "#[38;5;98m 98: 87/5f/d7", "#[38;5;99m 99: 87/5f/ff")] );
push(@arr, [( "#[38;5;100m 100: 87/87/00", "#[38;5;101m 101: 87/87/5f", "#[38;5;102m 102: 87/87/87", "#[38;5;103m 103: 87/87/af", "#[38;5;104m 104: 87/87/d7", "#[38;5;105m 105: 87/87/ff")] );
push(@arr, [( "#[38;5;106m 106: 87/af/00", "#[38;5;107m 107: 87/af/5f", "#[38;5;108m 108: 87/af/87", "#[38;5;109m 109: 87/af/af", "#[38;5;110m 110: 87/af/d7", "#[38;5;111m 111: 87/af/ff")] );
push(@arr, [( "#[38;5;112m 112: 87/d7/00", "#[38;5;113m 113: 87/d7/5f", "#[38;5;114m 114: 87/d7/87", "#[38;5;115m 115: 87/d7/af", "#[38;5;116m 116: 87/d7/d7", "#[38;5;117m 117: 87/d7/ff")] );
push(@arr, [( "#[38;5;118m 118: 87/ff/00", "#[38;5;119m 119: 87/ff/5f", "#[38;5;120m 120: 87/ff/87", "#[38;5;121m 121: 87/ff/af", "#[38;5;122m 122: 87/ff/d7", "#[38;5;123m 123: 87/ff/ff")] );
push(@arr, [( "#[38;5;124m 124: af/00/00", "#[38;5;125m 125: af/00/5f", "#[38;5;126m 126: af/00/87", "#[38;5;127m 127: af/00/af", "#[38;5;128m 128: af/00/d7", "#[38;5;129m 129: af/00/ff")] );
push(@arr, [( "#[38;5;130m 130: af/5f/00", "#[38;5;131m 131: af/5f/5f", "#[38;5;132m 132: af/5f/87", "#[38;5;133m 133: af/5f/af", "#[38;5;134m 134: af/5f/d7", "#[38;5;135m 135: af/5f/ff")] );
push(@arr, [( "#[38;5;136m 136: af/87/00", "#[38;5;137m 137: af/87/5f", "#[38;5;138m 138: af/87/87", "#[38;5;139m 139: af/87/af", "#[38;5;140m 140: af/87/d7", "#[38;5;141m 141: af/87/ff")] );
push(@arr, [( "#[38;5;142m 142: af/af/00", "#[38;5;143m 143: af/af/5f", "#[38;5;144m 144: af/af/87", "#[38;5;145m 145: af/af/af", "#[38;5;146m 146: af/af/d7", "#[38;5;147m 147: af/af/ff")] );
push(@arr, [( "#[38;5;148m 148: af/d7/00", "#[38;5;149m 149: af/d7/5f", "#[38;5;150m 150: af/d7/87", "#[38;5;151m 151: af/d7/af", "#[38;5;152m 152: af/d7/d7", "#[38;5;153m 153: af/d7/ff")] );
push(@arr, [( "#[38;5;154m 154: af/ff/00", "#[38;5;155m 155: af/ff/5f", "#[38;5;156m 156: af/ff/87", "#[38;5;157m 157: af/ff/af", "#[38;5;158m 158: af/ff/d7", "#[38;5;159m 159: af/ff/ff")] );
push(@arr, [( "#[38;5;160m 160: d7/00/00", "#[38;5;161m 161: d7/00/5f", "#[38;5;162m 162: d7/00/87", "#[38;5;163m 163: d7/00/af", "#[38;5;164m 164: d7/00/d7", "#[38;5;165m 165: d7/00/ff")] );
push(@arr, [( "#[38;5;166m 166: d7/5f/00", "#[38;5;167m 167: d7/5f/5f", "#[38;5;168m 168: d7/5f/87", "#[38;5;169m 169: d7/5f/af", "#[38;5;170m 170: d7/5f/d7", "#[38;5;171m 171: d7/5f/ff")] );
push(@arr, [( "#[38;5;172m 172: d7/87/00", "#[38;5;173m 173: d7/87/5f", "#[38;5;174m 174: d7/87/87", "#[38;5;175m 175: d7/87/af", "#[38;5;176m 176: d7/87/d7", "#[38;5;177m 177: d7/87/ff")] );
push(@arr, [( "#[38;5;178m 178: d7/af/00", "#[38;5;179m 179: d7/af/5f", "#[38;5;180m 180: d7/af/87", "#[38;5;181m 181: d7/af/af", "#[38;5;182m 182: d7/af/d7", "#[38;5;183m 183: d7/af/ff")] );
push(@arr, [( "#[38;5;184m 184: d7/d7/00", "#[38;5;185m 185: d7/d7/5f", "#[38;5;186m 186: d7/d7/87", "#[38;5;187m 187: d7/d7/af", "#[38;5;188m 188: d7/d7/d7", "#[38;5;189m 189: d7/d7/ff")] );
push(@arr, [( "#[38;5;190m 190: d7/ff/00", "#[38;5;191m 191: d7/ff/5f", "#[38;5;192m 192: d7/ff/87", "#[38;5;193m 193: d7/ff/af", "#[38;5;194m 194: d7/ff/d7", "#[38;5;195m 195: d7/ff/ff")] );
push(@arr, [( "#[38;5;196m 196: ff/00/00", "#[38;5;197m 197: ff/00/5f", "#[38;5;198m 198: ff/00/87", "#[38;5;199m 199: ff/00/af", "#[38;5;200m 200: ff/00/d7", "#[38;5;201m 201: ff/00/ff")] );
push(@arr, [( "#[38;5;202m 202: ff/5f/00", "#[38;5;203m 203: ff/5f/5f", "#[38;5;204m 204: ff/5f/87", "#[38;5;205m 205: ff/5f/af", "#[38;5;206m 206: ff/5f/d7", "#[38;5;207m 207: ff/5f/ff")] );
push(@arr, [( "#[38;5;208m 208: ff/87/00", "#[38;5;209m 209: ff/87/5f", "#[38;5;210m 210: ff/87/87", "#[38;5;211m 211: ff/87/af", "#[38;5;212m 212: ff/87/d7", "#[38;5;213m 213: ff/87/ff")] );
push(@arr, [( "#[38;5;214m 214: ff/af/00", "#[38;5;215m 215: ff/af/5f", "#[38;5;216m 216: ff/af/87", "#[38;5;217m 217: ff/af/af", "#[38;5;218m 218: ff/af/d7", "#[38;5;219m 219: ff/af/ff")] );
push(@arr, [( "#[38;5;220m 220: ff/d7/00", "#[38;5;221m 221: ff/d7/5f", "#[38;5;222m 222: ff/d7/87", "#[38;5;223m 223: ff/d7/af", "#[38;5;224m 224: ff/d7/d7", "#[38;5;225m 225: ff/d7/ff")] );
push(@arr, [( "#[38;5;226m 226: ff/ff/00", "#[38;5;227m 227: ff/ff/5f", "#[38;5;228m 228: ff/ff/87", "#[38;5;229m 229: ff/ff/af", "#[38;5;230m 230: ff/ff/d7", "#[38;5;231m 231: ff/ff/ff")] );
push(@arr, [( "#[38;5;232m 232: 08/08/08", "#[38;5;233m 233: 12/12/12", "#[38;5;234m 234: 1c/1c/1c", "#[38;5;235m 235: 26/26/26", "#[38;5;236m 236: 30/30/30", "#[38;5;237m 237: 3a/3a/3a")] );
push(@arr, [( "#[38;5;238m 238: 44/44/44", "#[38;5;239m 239: 4e/4e/4e", "#[38;5;240m 240: 58/58/58", "#[38;5;241m 241: 62/62/62", "#[38;5;242m 242: 6c/6c/6c", "#[38;5;243m 243: 76/76/76")] );
push(@arr, [( "#[38;5;244m 244: 80/80/80", "#[38;5;245m 245: 8a/8a/8a", "#[38;5;246m 246: 94/94/94", "#[38;5;247m 247: 9e/9e/9e", "#[38;5;248m 248: a8/a8/a8", "#[38;5;249m 249: b2/b2/b2")] );
push(@arr, [( "#[38;5;250m 250: bc/bc/bc", "#[38;5;251m 251: c6/c6/c6", "#[38;5;252m 252: d0/d0/d0", "#[38;5;253m 253: da/da/da", "#[38;5;254m 254: e4/e4/e4", "#[38;5;255m 255: ee/ee/ee")] );

if( $ARGV[0] eq "-s" || $ARGV[1] eq "-s" || $ARGV[2] eq "-s" ){
$padding = " ";
}
else {

}

# display in reverse order
if( $ARGV[0] eq "-r" || $ARGV[1] eq "-r" || $ARGV[2] eq "-r" ){
for( $dimone = 0; $dimone < scalar @arr; $dimone++ ) {

$seed = ($dimone % 6) * -1;
for( $dimtwo = 0; $dimtwo < 6; $dimtwo++ ) {

$movone = $seed;
$movtwo = $seed * -1;

print $arr[$dimone][$dimtwo] . $padding;

$seed = $seed+1;
}

print "\n";
}
}
else {
for( $dimone = 0; $dimone < scalar @arr; $dimone++ ) {

$seed = ($dimone % 6) * -1;
for( $dimtwo = 0; $dimtwo < 6; $dimtwo++ ) {

$movone = $seed;
$movtwo = $seed * -1;

$newone = $dimone+$movone;
$newtwo = $dimtwo+$movtwo;

if( $newone < scalar @arr ){
print $arr[$newone][$newtwo] . $padding;
}

$seed = $seed+1;
}

print "\n";
}
}
print "\n";
print "\n";

}
else {
print "#[38;5;16m 16: 00/00/00\n";
print "#[38;5;17m 17: 00/00/5f\n";
print "#[38;5;18m 18: 00/00/87\n";
print "#[38;5;19m 19: 00/00/af\n";
print "#[38;5;20m 20: 00/00/d7\n";
print "#[38;5;21m 21: 00/00/ff\n";
print "#[38;5;22m 22: 00/5f/00\n";
print "#[38;5;23m 23: 00/5f/5f\n";
print "#[38;5;24m 24: 00/5f/87\n";
print "#[38;5;25m 25: 00/5f/af\n";
print "#[38;5;26m 26: 00/5f/d7\n";
print "#[38;5;27m 27: 00/5f/ff\n";
print "#[38;5;28m 28: 00/87/00\n";
print "#[38;5;29m 29: 00/87/5f\n";
print "#[38;5;30m 30: 00/87/87\n";
print "#[38;5;31m 31: 00/87/af\n";
print "#[38;5;32m 32: 00/87/d7\n";
print "#[38;5;33m 33: 00/87/ff\n";
print "#[38;5;34m 34: 00/af/00\n";
print "#[38;5;35m 35: 00/af/5f\n";
print "#[38;5;36m 36: 00/af/87\n";
print "#[38;5;37m 37: 00/af/af\n";
print "#[38;5;38m 38: 00/af/d7\n";
print "#[38;5;39m 39: 00/af/ff\n";
print "#[38;5;40m 40: 00/d7/00\n";
print "#[38;5;41m 41: 00/d7/5f\n";
print "#[38;5;42m 42: 00/d7/87\n";
print "#[38;5;43m 43: 00/d7/af\n";
print "#[38;5;44m 44: 00/d7/d7\n";
print "#[38;5;45m 45: 00/d7/ff\n";
print "#[38;5;46m 46: 00/ff/00\n";
print "#[38;5;47m 47: 00/ff/5f\n";
print "#[38;5;48m 48: 00/ff/87\n";
print "#[38;5;49m 49: 00/ff/af\n";
print "#[38;5;50m 50: 00/ff/d7\n";
print "#[38;5;51m 51: 00/ff/ff\n";
print "#[38;5;52m 52: 5f/00/00\n";
print "#[38;5;53m 53: 5f/00/5f\n";
print "#[38;5;54m 54: 5f/00/87\n";
print "#[38;5;55m 55: 5f/00/af\n";
print "#[38;5;56m 56: 5f/00/d7\n";
print "#[38;5;57m 57: 5f/00/ff\n";
print "#[38;5;58m 58: 5f/5f/00\n";
print "#[38;5;59m 59: 5f/5f/5f\n";
print "#[38;5;60m 60: 5f/5f/87\n";
print "#[38;5;61m 61: 5f/5f/af\n";
print "#[38;5;62m 62: 5f/5f/d7\n";
print "#[38;5;63m 63: 5f/5f/ff\n";
print "#[38;5;64m 64: 5f/87/00\n";
print "#[38;5;65m 65: 5f/87/5f\n";
print "#[38;5;66m 66: 5f/87/87\n";
print "#[38;5;67m 67: 5f/87/af\n";
print "#[38;5;68m 68: 5f/87/d7\n";
print "#[38;5;69m 69: 5f/87/ff\n";
print "#[38;5;70m 70: 5f/af/00\n";
print "#[38;5;71m 71: 5f/af/5f\n";
print "#[38;5;72m 72: 5f/af/87\n";
print "#[38;5;73m 73: 5f/af/af\n";
print "#[38;5;74m 74: 5f/af/d7\n";
print "#[38;5;75m 75: 5f/af/ff\n";
print "#[38;5;76m 76: 5f/d7/00\n";
print "#[38;5;77m 77: 5f/d7/5f\n";
print "#[38;5;78m 78: 5f/d7/87\n";
print "#[38;5;79m 79: 5f/d7/af\n";
print "#[38;5;80m 80: 5f/d7/d7\n";
print "#[38;5;81m 81: 5f/d7/ff\n";
print "#[38;5;82m 82: 5f/ff/00\n";
print "#[38;5;83m 83: 5f/ff/5f\n";
print "#[38;5;84m 84: 5f/ff/87\n";
print "#[38;5;85m 85: 5f/ff/af\n";
print "#[38;5;86m 86: 5f/ff/d7\n";
print "#[38;5;87m 87: 5f/ff/ff\n";
print "#[38;5;88m 88: 87/00/00\n";
print "#[38;5;89m 89: 87/00/5f\n";
print "#[38;5;90m 90: 87/00/87\n";
print "#[38;5;91m 91: 87/00/af\n";
print "#[38;5;92m 92: 87/00/d7\n";
print "#[38;5;93m 93: 87/00/ff\n";
print "#[38;5;94m 94: 87/5f/00\n";
print "#[38;5;95m 95: 87/5f/5f\n";
print "#[38;5;96m 96: 87/5f/87\n";
print "#[38;5;97m 97: 87/5f/af\n";
print "#[38;5;98m 98: 87/5f/d7\n";
print "#[38;5;99m 99: 87/5f/ff\n";
print "#[38;5;100m 100 :87/87/00\n";
print "#[38;5;101m 101 :87/87/5f\n";
print "#[38;5;102m 102 :87/87/87\n";
print "#[38;5;103m 103 :87/87/af\n";
print "#[38;5;104m 104 :87/87/d7\n";
print "#[38;5;105m 105 :87/87/ff\n";
print "#[38;5;106m 106 :87/af/00\n";
print "#[38;5;107m 107 :87/af/5f\n";
print "#[38;5;108m 108 :87/af/87\n";
print "#[38;5;109m 109 :87/af/af\n";
print "#[38;5;110m 110 :87/af/d7\n";
print "#[38;5;111m 111 :87/af/ff\n";
print "#[38;5;112m 112 :87/d7/00\n";
print "#[38;5;113m 113 :87/d7/5f\n";
print "#[38;5;114m 114 :87/d7/87\n";
print "#[38;5;115m 115 :87/d7/af\n";
print "#[38;5;116m 116 :87/d7/d7\n";
print "#[38;5;117m 117 :87/d7/ff\n";
print "#[38;5;118m 118 :87/ff/00\n";
print "#[38;5;119m 119 :87/ff/5f\n";
print "#[38;5;120m 120 :87/ff/87\n";
print "#[38;5;121m 121 :87/ff/af\n";
print "#[38;5;122m 122 :87/ff/d7\n";
print "#[38;5;123m 123 :87/ff/ff\n";
print "#[38;5;124m 124 :af/00/00\n";
print "#[38;5;125m 125 :af/00/5f\n";
print "#[38;5;126m 126 :af/00/87\n";
print "#[38;5;127m 127 :af/00/af\n";
print "#[38;5;128m 128 :af/00/d7\n";
print "#[38;5;129m 129 :af/00/ff\n";
print "#[38;5;130m 130 :af/5f/00\n";
print "#[38;5;131m 131 :af/5f/5f\n";
print "#[38;5;132m 132 :af/5f/87\n";
print "#[38;5;133m 133 :af/5f/af\n";
print "#[38;5;134m 134 :af/5f/d7\n";
print "#[38;5;135m 135 :af/5f/ff\n";
print "#[38;5;136m 136 :af/87/00\n";
print "#[38;5;137m 137 :af/87/5f\n";
print "#[38;5;138m 138 :af/87/87\n";
print "#[38;5;139m 139 :af/87/af\n";
print "#[38;5;140m 140 :af/87/d7\n";
print "#[38;5;141m 141 :af/87/ff\n";
print "#[38;5;142m 142 :af/af/00\n";
print "#[38;5;143m 143 :af/af/5f\n";
print "#[38;5;144m 144 :af/af/87\n";
print "#[38;5;145m 145 :af/af/af\n";
print "#[38;5;146m 146 :af/af/d7\n";
print "#[38;5;147m 147 :af/af/ff\n";
print "#[38;5;148m 148 :af/d7/00\n";
print "#[38;5;149m 149 :af/d7/5f\n";
print "#[38;5;150m 150 :af/d7/87\n";
print "#[38;5;151m 151 :af/d7/af\n";
print "#[38;5;152m 152 :af/d7/d7\n";
print "#[38;5;153m 153 :af/d7/ff\n";
print "#[38;5;154m 154 :af/ff/00\n";
print "#[38;5;155m 155 :af/ff/5f\n";
print "#[38;5;156m 156 :af/ff/87\n";
print "#[38;5;157m 157 :af/ff/af\n";
print "#[38;5;158m 158 :af/ff/d7\n";
print "#[38;5;159m 159 :af/ff/ff\n";
print "#[38;5;160m 160 :d7/00/00\n";
print "#[38;5;161m 161 :d7/00/5f\n";
print "#[38;5;162m 162 :d7/00/87\n";
print "#[38;5;163m 163 :d7/00/af\n";
print "#[38;5;164m 164 :d7/00/d7\n";
print "#[38;5;165m 165 :d7/00/ff\n";
print "#[38;5;166m 166 :d7/5f/00\n";
print "#[38;5;167m 167 :d7/5f/5f\n";
print "#[38;5;168m 168 :d7/5f/87\n";
print "#[38;5;169m 169 :d7/5f/af\n";
print "#[38;5;170m 170 :d7/5f/d7\n";
print "#[38;5;171m 171 :d7/5f/ff\n";
print "#[38;5;172m 172 :d7/87/00\n";
print "#[38;5;173m 173 :d7/87/5f\n";
print "#[38;5;174m 174 :d7/87/87\n";
print "#[38;5;175m 175 :d7/87/af\n";
print "#[38;5;176m 176 :d7/87/d7\n";
print "#[38;5;177m 177 :d7/87/ff\n";
print "#[38;5;178m 178 :d7/af/00\n";
print "#[38;5;179m 179 :d7/af/5f\n";
print "#[38;5;180m 180 :d7/af/87\n";
print "#[38;5;181m 181 :d7/af/af\n";
print "#[38;5;182m 182 :d7/af/d7\n";
print "#[38;5;183m 183 :d7/af/ff\n";
print "#[38;5;184m 184 :d7/d7/00\n";
print "#[38;5;185m 185 :d7/d7/5f\n";
print "#[38;5;186m 186 :d7/d7/87\n";
print "#[38;5;187m 187 :d7/d7/af\n";
print "#[38;5;188m 188 :d7/d7/d7\n";
print "#[38;5;189m 189 :d7/d7/ff\n";
print "#[38;5;190m 190 :d7/ff/00\n";
print "#[38;5;191m 191 :d7/ff/5f\n";
print "#[38;5;192m 192 :d7/ff/87\n";
print "#[38;5;193m 193 :d7/ff/af\n";
print "#[38;5;194m 194 :d7/ff/d7\n";
print "#[38;5;195m 195 :d7/ff/ff\n";
print "#[38;5;196m 196 :ff/00/00\n";
print "#[38;5;197m 197 :ff/00/5f\n";
print "#[38;5;198m 198 :ff/00/87\n";
print "#[38;5;199m 199 :ff/00/af\n";
print "#[38;5;200m 200 :ff/00/d7\n";
print "#[38;5;201m 201 :ff/00/ff\n";
print "#[38;5;202m 202 :ff/5f/00\n";
print "#[38;5;203m 203 :ff/5f/5f\n";
print "#[38;5;204m 204 :ff/5f/87\n";
print "#[38;5;205m 205 :ff/5f/af\n";
print "#[38;5;206m 206 :ff/5f/d7\n";
print "#[38;5;207m 207 :ff/5f/ff\n";
print "#[38;5;208m 208 :ff/87/00\n";
print "#[38;5;209m 209 :ff/87/5f\n";
print "#[38;5;210m 210 :ff/87/87\n";
print "#[38;5;211m 211 :ff/87/af\n";
print "#[38;5;212m 212 :ff/87/d7\n";
print "#[38;5;213m 213 :ff/87/ff\n";
print "#[38;5;214m 214 :ff/af/00\n";
print "#[38;5;215m 215 :ff/af/5f\n";
print "#[38;5;216m 216 :ff/af/87\n";
print "#[38;5;217m 217 :ff/af/af\n";
print "#[38;5;218m 218 :ff/af/d7\n";
print "#[38;5;219m 219 :ff/af/ff\n";
print "#[38;5;220m 220 :ff/d7/00\n";
print "#[38;5;221m 221 :ff/d7/5f\n";
print "#[38;5;222m 222 :ff/d7/87\n";
print "#[38;5;223m 223 :ff/d7/af\n";
print "#[38;5;224m 224 :ff/d7/d7\n";
print "#[38;5;225m 225 :ff/d7/ff\n";
print "#[38;5;226m 226 :ff/ff/00\n";
print "#[38;5;227m 227 :ff/ff/5f\n";
print "#[38;5;228m 228 :ff/ff/87\n";
print "#[38;5;229m 229 :ff/ff/af\n";
print "#[38;5;230m 230 :ff/ff/d7\n";
print "#[38;5;231m 231 :ff/ff/ff\n";
print "#[38;5;232m 232 :08/08/08\n";
print "#[38;5;233m 233 :12/12/12\n";
print "#[38;5;234m 234 :1c/1c/1c\n";
print "#[38;5;235m 235 :26/26/26\n";
print "#[38;5;236m 236 :30/30/30\n";
print "#[38;5;237m 237 :3a/3a/3a\n";
print "#[38;5;238m 238 :44/44/44\n";
print "#[38;5;239m 239 :4e/4e/4e\n";
print "#[38;5;240m 240 :58/58/58\n";
print "#[38;5;241m 241 :62/62/62\n";
print "#[38;5;242m 242 :6c/6c/6c\n";
print "#[38;5;243m 243 :76/76/76\n";
print "#[38;5;244m 244 :80/80/80\n";
print "#[38;5;245m 245 :8a/8a/8a\n";
print "#[38;5;246m 246 :94/94/94\n";
print "#[38;5;247m 247 :9e/9e/9e\n";
print "#[38;5;248m 248 :a8/a8/a8\n";
print "#[38;5;249m 249 :b2/b2/b2\n";
print "#[38;5;250m 250 :bc/bc/bc\n";
print "#[38;5;251m 251 :c6/c6/c6\n";
print "#[38;5;252m 252 :d0/d0/d0\n";
print "#[38;5;253m 253 :da/da/da\n";
print "#[38;5;254m 254 :e4/e4/e4\n";
print "#[38;5;255m 255 :ee/ee/ee\n";
print "\n";
print "\n";
}
print "#0m";
exit;

R:0 / I:0 / P:2 [R] [G] [-]

One-Line Scripts for Sed

If you need help with sed (stream editor), this thread is for you!

Actually, this is a cheat. I'm just copy/pasting from another link, but the original links are as follows.

-------------------------------------------------------------------------
USEFUL ONE-LINE SCRIPTS FOR SED (Unix stream editor) Dec. 29, 2005
Compiled by Eric Pement - pemente[at]northpark[dot]edu version 5.5

Latest version of this file (in English) is usually at:
http://sed.sourceforge.net/sed1line.txt
http://www.pement.org/sed/sed1line.txt

This file will also available in other languages:
Chinese - http://sed.sourceforge.net/sed1line_zh-CN.html
Czech - http://sed.sourceforge.net/sed1line_cz.html
Dutch - http://sed.sourceforge.net/sed1line_nl.html
French - http://sed.sourceforge.net/sed1line_fr.html
German - http://sed.sourceforge.net/sed1line_de.html
Italian - (pending)
Portuguese - http://sed.sourceforge.net/sed1line_pt-BR.html
Spanish - (pending)


FILE SPACING:

# double space a file
sed G

# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'

# triple space a file
sed 'G;G'

# undo double-spacing (assumes even-numbered lines are always blank)
sed 'n;d'

# insert a blank line above every line which matches "regex"
sed '/regex/{x;p;x;}'

# insert a blank line below every line which matches "regex"
sed '/regex/G'

# insert a blank line above and below every line which matches "regex"
sed '/regex/{x;p;x;G;}'

NUMBERING:

# number each line of a file (simple left alignment). Using a tab (see
# note on '\t' at end of file) instead of space will preserve margins.
sed = filename | sed 'N;s/\n/\t/'

# number each line of a file (number on left, right-aligned)
sed = filename | sed 'N; s/^/ /; s/ *\(.\{6,\}\)\n/\1 /'

# number each line of file, but only print numbers if line is not blank
sed '/./=' filename | sed '/./N; s/\n/ /'

# count lines (emulates "wc -l")
sed -n '$='

TEXT CONVERSION AND SUBSTITUTION:

# IN UNIX ENVIRONMENT: convert DOS newlines (CR/LF) to Unix format.
sed 's/.$//' # assumes that all lines end with CR/LF
sed 's/^M$//' # in bash/tcsh, press Ctrl-V then Ctrl-M
sed 's/\x0D$//' # works on ssed, gsed 3.02.80 or higher

# IN UNIX ENVIRONMENT: convert Unix newlines (LF) to DOS format.
sed "s/$/`echo -e \\\r`/" # command line under ksh
sed 's/$'"/`echo \\\r`/" # command line under bash
sed "s/$/`echo \\\r`/" # command line under zsh
sed 's/$/\r/' # gsed 3.02.80 or higher

# IN DOS ENVIRONMENT: convert Unix newlines (LF) to DOS format.
sed "s/$//" # method 1
sed -n p # method 2

# IN DOS ENVIRONMENT: convert DOS newlines (CR/LF) to Unix format.
# Can only be done with UnxUtils sed, version 4.0.7 or higher. The
# UnxUtils version can be identified by the custom "--text" switch
# which appears when you use the "--help" switch. Otherwise, changing
# DOS newlines to Unix newlines cannot be done with sed in a DOS
# environment. Use "tr" instead.
sed "s/\r//" infile >outfile # UnxUtils sed v4.0.7 or higher
tr -d \r <infile >outfile # GNU tr version 1.22 or higher

# delete leading whitespace (spaces, tabs) from front of each line
# aligns all text flush left
sed 's/^[ \t]*//' # see note on '\t' at end of file

# delete trailing whitespace (spaces, tabs) from end of each line
sed 's/[ \t]*$//' # see note on '\t' at end of file

# delete BOTH leading and trailing whitespace from each line
sed 's/^[ \t]*//;s/[ \t]*$//'

# insert 5 blank spaces at beginning of each line (make page offset)
sed 's/^/ /'

# align all text flush right on a 79-column width
sed -e :a -e 's/^.\{1,78\}$/ &/;ta' # set at 78 plus 1 space

# center all text in the middle of 79-column width. In method 1,
# spaces at the beginning of the line are significant, and trailing
# spaces are appended at the end of the line. In method 2, spaces at
# the beginning of the line are discarded in centering the line, and
# no trailing spaces appear at the end of lines.
sed -e :a -e 's/^.\{1,77\}$/ & /;ta' # method 1
sed -e :a -e 's/^.\{1,77\}$/ &/;ta' -e 's/\( *\)\1/\1/' # method 2

# substitute (find and replace) "foo" with "bar" on each line
sed 's/foo/bar/' # replaces only 1st instance in a line
sed 's/foo/bar/4' # replaces only 4th instance in a line
sed 's/foo/bar/g' # replaces ALL instances in a line
sed 's/\(.*\)foo\(.*foo\)/\1bar\2/' # replace the next-to-last case
sed 's/\(.*\)foo/\1bar/' # replace only the last case

# substitute "foo" with "bar" ONLY for lines which contain "baz"
sed '/baz/s/foo/bar/g'

# substitute "foo" with "bar" EXCEPT for lines which contain "baz"
sed '/baz/!s/foo/bar/g'

# change "scarlet" or "ruby" or "puce" to "red"
sed 's/scarlet/red/g;s/ruby/red/g;s/puce/red/g' # most seds
gsed 's/scarlet\|ruby\|puce/red/g' # GNU sed only

# reverse order of lines (emulates "tac")
# bug/feature in HHsed v1.5 causes blank lines to be deleted
sed '1!G;h;$!d' # method 1
sed -n '1!G;h;$p' # method 2

# reverse each character on the line (emulates "rev")
sed '/\n/!G;s/\(.\)\(.*\n\)/&\2\1/;//D;s/.//'

# join pairs of lines side-by-side (like "paste")
sed '$!N;s/\n/ /'

# if a line ends with a backslash, append the next line to it
sed -e :a -e '/\\$/N; s/\\\n//; ta'

# if a line begins with an equal sign, append it to the previous line
# and replace the "=" with a single space
sed -e :a -e '$!N;s/\n=/ /;ta' -e 'P;D'

# add commas to numeric strings, changing "1234567" to "1,234,567"
gsed ':a;s/\B[0-9]\{3\}\>/,&/;ta' # GNU sed
sed -e :a -e 's/\(.*[0-9]\)\([0-9]\{3\}\)/\1,\2/;ta' # other seds

# add commas to numbers with decimal points and minus signs (GNU sed)
gsed -r ':a;s/(^|[^0-9.])([0-9]+)([0-9]{3})/\1\2,\3/g;ta'

# add a blank line every 5 lines (after lines 5, 10, 15, 20, etc.)
gsed '0~5G' # GNU sed only
sed 'n;n;n;n;G;' # other seds

SELECTIVE PRINTING OF CERTAIN LINES:

# print first 10 lines of file (emulates behavior of "head")
sed 10q

# print first line of file (emulates "head -1")
sed q

# print the last 10 lines of a file (emulates "tail")
sed -e :a -e '$q;N;11,$D;ba'

# print the last 2 lines of a file (emulates "tail -2")
sed '$!N;$!D'

# print the last line of a file (emulates "tail -1")
sed '$!d' # method 1
sed -n '$p' # method 2

# print the next-to-the-last line of a file
sed -e '$!{h;d;}' -e x # for 1-line files, print blank line
sed -e '1{$q;}' -e '$!{h;d;}' -e x # for 1-line files, print the line
sed -e '1{$d;}' -e '$!{h;d;}' -e x # for 1-line files, print nothing

# print only lines which match regular expression (emulates "grep")
sed -n '/regexp/p' # method 1
sed '/regexp/!d' # method 2

# print only lines which do NOT match regexp (emulates "grep -v")
sed -n '/regexp/!p' # method 1, corresponds to above
sed '/regexp/d' # method 2, simpler syntax

# print the line immediately before a regexp, but not the line
# containing the regexp
sed -n '/regexp/{g;1!p;};h'

# print the line immediately after a regexp, but not the line
# containing the regexp
sed -n '/regexp/{n;p;}'

# print 1 line of context before and after regexp, with line number
# indicating where the regexp occurred (similar to "grep -A1 -B1")
sed -n -e '/regexp/{=;x;1!p;g;$!N;p;D;}' -e h

# grep for AAA and BBB and CCC (in any order)
sed '/AAA/!d; /BBB/!d; /CCC/!d'

# grep for AAA and BBB and CCC (in that order)
sed '/AAA.*BBB.*CCC/!d'

# grep for AAA or BBB or CCC (emulates "egrep")
sed -e '/AAA/b' -e '/BBB/b' -e '/CCC/b' -e d # most seds
gsed '/AAA\|BBB\|CCC/!d' # GNU sed only

# print paragraph if it contains AAA (blank lines separate paragraphs)
# HHsed v1.5 must insert a 'G;' after 'x;' in the next 3 scripts below
sed -e '/./{H;$!d;}' -e 'x;/AAA/!d;'

# print paragraph if it contains AAA and BBB and CCC (in any order)
sed -e '/./{H;$!d;}' -e 'x;/AAA/!d;/BBB/!d;/CCC/!d'

# print paragraph if it contains AAA or BBB or CCC
sed -e '/./{H;$!d;}' -e 'x;/AAA/b' -e '/BBB/b' -e '/CCC/b' -e d
gsed '/./{H;$!d;};x;/AAA\|BBB\|CCC/b;d' # GNU sed only

# print only lines of 65 characters or longer
sed -n '/^.\{65\}/p'

# print only lines of less than 65 characters
sed -n '/^.\{65\}/!p' # method 1, corresponds to above
sed '/^.\{65\}/d' # method 2, simpler syntax

# print section of file from regular expression to end of file
sed -n '/regexp/,$p'

# print section of file based on line numbers (lines 8-12, inclusive)
sed -n '8,12p' # method 1
sed '8,12!d' # method 2

# print line number 52
sed -n '52p' # method 1
sed '52!d' # method 2
sed '52q;d' # method 3, efficient on large files

# beginning at line 3, print every 7th line
gsed -n '3~7p' # GNU sed only
sed -n '3,${p;n;n;n;n;n;n;}' # other seds

# print section of file between two regular expressions (inclusive)
sed -n '/Iowa/,/Montana/p' # case sensitive

SELECTIVE DELETION OF CERTAIN LINES:

# print all of file EXCEPT section between 2 regular expressions
sed '/Iowa/,/Montana/d'

# delete duplicate, consecutive lines from a file (emulates "uniq").
# First line in a set of duplicate lines is kept, rest are deleted.
sed '$!N; /^\(.*\)\n\1$/!P; D'

# delete duplicate, nonconsecutive lines from a file. Beware not to
# overflow the buffer size of the hold space, or else use GNU sed.
sed -n 'G; s/\n/&&/; /^\([ -~]*\n\).*\n\1/d; s/\n//; h; P'

# delete all lines except duplicate lines (emulates "uniq -d").
sed '$!N; s/^\(.*\)\n\1$/\1/; t; D'

# delete the first 10 lines of a file
sed '1,10d'

# delete the last line of a file
sed '$d'

# delete the last 2 lines of a file
sed 'N;$!P;$!D;$d'

# delete the last 10 lines of a file
sed -e :a -e '$d;N;2,10ba' -e 'P;D' # method 1
sed -n -e :a -e '1,10!{P;N;D;};N;ba' # method 2

# delete every 8th line
gsed '0~8d' # GNU sed only
sed 'n;n;n;n;n;n;n;d;' # other seds

# delete lines matching pattern
sed '/pattern/d'

# delete ALL blank lines from a file (same as "grep '.' ")
sed '/^$/d' # method 1
sed '/./!d' # method 2

# delete all CONSECUTIVE blank lines from file except the first; also
# deletes all blank lines from top and end of file (emulates "cat -s")
sed '/./,/^$/!d' # method 1, allows 0 blanks at top, 1 at EOF
sed '/^$/N;/\n$/D' # method 2, allows 1 blank at top, 0 at EOF

# delete all CONSECUTIVE blank lines from file except the first 2:
sed '/^$/N;/\n$/N;//D'

# delete all leading blank lines at top of file
sed '/./,$!d'

# delete all trailing blank lines at end of file
sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' # works on all seds
sed -e :a -e '/^\n*$/N;/\n$/ba' # ditto, except for gsed 3.02.*

# delete the last line of each paragraph
sed -n '/^$/{p;h;};/./{x;/./p;}'

SPECIAL APPLICATIONS:

# remove nroff overstrikes (char, backspace) from man pages. The 'echo'
# command may need an -e switch if you use Unix System V or bash shell.
sed "s/.`echo \\\b`//g" # double quotes required for Unix environment
sed 's/.^H//g' # in bash/tcsh, press Ctrl-V and then Ctrl-H
sed 's/.\x08//g' # hex expression for sed 1.5, GNU sed, ssed

# get Usenet/e-mail message header
sed '/^$/q' # deletes everything after first blank line

# get Usenet/e-mail message body
sed '1,/^$/d' # deletes everything up to first blank line

# get Subject header, but remove initial "Subject: " portion
sed '/^Subject: */!d; s///;q'

# get return address header
sed '/^Reply-To:/q; /^From:/h; /./d;g;q'

# parse out the address proper. Pulls out the e-mail address by itself
# from the 1-line return address header (see preceding script)
sed 's/ *(.*)//; s/>.*//; s/.*[:<] *//'

# add a leading angle bracket and space to each line (quote a message)
sed 's/^/> /'

# delete leading angle bracket & space from each line (unquote a message)
sed 's/^> //'

# remove most HTML tags (accommodates multiple-line tags)
sed -e :a -e 's/<[^>]*>//g;/</N;//ba'

# extract multi-part uuencoded binaries, removing extraneous header
# info, so that only the uuencoded portion remains. Files passed to
# sed must be passed in the proper order. Version 1 can be entered
# from the command line; version 2 can be made into an executable
# Unix shell script. (Modified from a script by Rahul Dhesi.)
sed '/^end/,/^begin/d' file1 file2 ... fileX | uudecode # vers. 1
sed '/^end/,/^begin/d' "$@" | uudecode # vers. 2

# sort paragraphs of file alphabetically. Paragraphs are separated by blank
# lines. GNU sed uses \v for vertical tab, or any unique char will do.
sed '/./{H;d;};x;s/\n/={NL}=/g' file | sort | sed '1s/={NL}=//;s/={NL}=/\n/g'
gsed '/./{H;d};x;y/\n/\v/' file | sort | sed '1s/\v//;y/\v/\n/'

# zip up each .TXT file individually, deleting the source file and
# setting the name of each .ZIP file to the basename of the .TXT file
# (under DOS: the "dir /b" switch returns bare filenames in all caps).
echo @echo off >zipup.bat
dir /b *.txt | sed "s/^\(.*\)\.TXT/pkzip -mo \1 \1.TXT/" >>zipup.bat

TYPICAL USE: Sed takes one or more editing commands and applies all of
them, in sequence, to each line of input. After all the commands have
been applied to the first input line, that line is output and a second
input line is taken for processing, and the cycle repeats. The
preceding examples assume that input comes from the standard input
device (i.e, the console, normally this will be piped input). One or
more filenames can be appended to the command line if the input does
not come from stdin. Output is sent to stdout (the screen). Thus:

cat filename | sed '10q' # uses piped input
sed '10q' filename # same effect, avoids a useless "cat"
sed '10q' filename > newfile # redirects output to disk

For additional syntax instructions, including the way to apply editing
commands from a disk file instead of the command line, consult "sed &
awk, 2nd Edition," by Dale Dougherty and Arnold Robbins (O'Reilly,
1997; http://www.ora.com), "UNIX Text Processing," by Dale Dougherty
and Tim O'Reilly (Hayden Books, 1987) or the tutorials by Mike Arst
distributed in U-SEDIT2.ZIP (many sites). To fully exploit the power
of sed, one must understand "regular expressions." For this, see
"Mastering Regular Expressions" by Jeffrey Friedl (O'Reilly, 1997).
The manual ("man") pages on Unix systems may be helpful (try "man
sed", "man regexp", or the subsection on regular expressions in "man
ed"), but man pages are notoriously difficult. They are not written to
teach sed use or regexps to first-time users, but as a reference text
for those already acquainted with these tools.

QUOTING SYNTAX: The preceding examples use single quotes ('...')
instead of double quotes ("...") to enclose editing commands, since
sed is typically used on a Unix platform. Single quotes prevent the
Unix shell from intrepreting the dollar sign ($) and backquotes
(`...`), which are expanded by the shell if they are enclosed in
double quotes. Users of the "csh" shell and derivatives will also need
to quote the exclamation mark (!) with the backslash (i.e., \!) to
properly run the examples listed above, even within single quotes.
Versions of sed written for DOS invariably require double quotes
("...") instead of single quotes to enclose editing commands.

USE OF '\t' IN SED SCRIPTS: For clarity in documentation, we have used
the expression '\t' to indicate a tab character (0x09) in the scripts.
However, most versions of sed do not recognize the '\t' abbreviation,
so when typing these scripts from the command line, you should press
the TAB key instead. '\t' is supported as a regular expression
metacharacter in awk, perl, and HHsed, sedmod, and GNU sed v3.02.80.

VERSIONS OF SED: Versions of sed do differ, and some slight syntax
variation is to be expected. In particular, most do not support the
use of labels (:name) or branch instructions (b,t) within editing
commands, except at the end of those commands. We have used the syntax
which will be portable to most users of sed, even though the popular
GNU versions of sed allow a more succinct syntax. When the reader sees
a fairly long command such as this:

sed -e '/AAA/b' -e '/BBB/b' -e '/CCC/b' -e d

it is heartening to know that GNU sed will let you reduce it to:

sed '/AAA/b;/BBB/b;/CCC/b;d' # or even
sed '/AAA\|BBB\|CCC/b;d'

In addition, remember that while many versions of sed accept a command
like "/one/ s/RE1/RE2/", some do NOT allow "/one/! s/RE1/RE2/", which
contains space before the 's'. Omit the space when typing the command.

OPTIMIZING FOR SPEED: If execution speed needs to be increased (due to
large input files or slow processors or hard disks), substitution will
be executed more quickly if the "find" expression is specified before
giving the "s/.../.../" instruction. Thus:

sed 's/foo/bar/g' filename # standard replace command
sed '/foo/ s/foo/bar/g' filename # executes more quickly
sed '/foo/ s//bar/g' filename # shorthand sed syntax

On line selection or deletion in which you only need to output lines
from the first part of the file, a "quit" command (q) in the script
will drastically reduce processing time for large files. Thus:

sed -n '45,50p' filename # print line nos. 45-50 of a file
sed -n '51q;45,50p' filename # same, but executes much faster

If you have any additional scripts to contribute or if you find errors
in this document, please send e-mail to the compiler. Indicate the
version of sed you used, the operating system it was compiled for, and
the nature of the problem. To qualify as a one-liner, the command line
must be 65 characters or less. Various scripts in this file have been
written or contributed by:

Al Aab # founder of "seders" list
Edgar Allen # various
Yiorgos Adamopoulos # various
Dale Dougherty # author of "sed & awk"
Carlos Duarte # author of "do it with sed"
Eric Pement # author of this document
Ken Pizzini # author of GNU sed v3.02
S.G. Ravenhall # great de-html script
Greg Ubben # many contributions & much help
-------------------------------------------------------------------------

R:0 / I:0 / P:2 [R] [G] [-]

Local Caching Name Server - BIND & DNS

If you're interested in running a Local DNS (Domain Name System) for your machine, the instructions are as follows. Please remember that this guide is only for local DNS requests. Other machines in the network (if you have any) will not be able to use it, unless some more work is done (I won't get into that).

1. Download an updated version of named.root and replace the current one (/var/named/caching-example/named.root). Even better, rename the original named.root to something like named.root.orig just in case:

$ curl 'ftp://ftp.internic.net/domain/named.root'

$ sudo cp /var/named/caching-example/named.root /var/named/caching-example/named.root.orig

$ sudo mv named.root /var/named/caching-example/named.root

2. Make BIND's daemon executable:

$ sudo chmod 755 /etc/rc.d/rc.bind

3. Start BIND:

$ sudo /etc/rc.d/rc.bind start

4. Make sure /etc/resolv.conf is using the local IP Address of the machine running BIND. You should have a line like this "nameserver <local ip address>" commented out (remove the # at the beginning of the line if there is one). If you're using NetworkManager to configure DNS requests (which I think it can do), you'll need to configure it properly. Any other nameserver lines in /etc/resolv.conf must be commented out (put a # at the beginning of the line so it's not used).

Example of a working line in /etc/resolv.conf: nameserver 192.168.0.1

5. Verify that it's working:

$ dig localhost

You should see the IP Address in "SERVER:"

or

$ nslookup localhost

You should see the IP Address in "Server:"

6. Once it's working, you may want to dump the server caches and zones to a file for inspection:

$ sudo rndc dumpdb -all

$ most /var/named/named_dump.db (instead of most you can use more/less/cat/etc; you might have opted not to install most)

Source: http://www.basicconfig.com/slackware_linux_dns_server_setup

Compass.

R:0 / I:0 / P:2 [R] [G] [-]

Terminal Clock

Below is the bash script for the terminal clock that I use. To quit the clock, use Ctrl + c.

#!/bin/bash
# clock.sh

# the script is executed inside a while without conditions
while :
do
# time and date are formatted to show HH:MM:SS YYYY-MM-DD
cmd=`date +"%c"`

# cursor's current position is saved through an escape sequence
echo -n -e "\033[s"

# Uncomment the next two lines to clean up the whole first line, although it causes a lot of blinking
#tput cup 0 0 # positions on row 0 col 0 (left top corner)
#tput el # cleans from position to end of line

# to place the clock on the appropriate column, subtract the length of 'HH:MM:SS YYYY-MM-DD', which is 19,
# from the total number of columns
C=$((`tput cols` - 32))
tput cup 0 $C # positions cursor at row 0 col $C

# clock will be shown green inverted
# setaf 2 = green, smso = inverted
COLOR=`tput setaf 7; tput smso`

# back to normal screen colors
NORMAL=`tput sgr0`

# print the time-date output on the above position
echo -n $COLOR$cmd$NORMAL

# restore the cursor to whatever was its previous position
echo -n -e "\033[u"

# script is executed every second
sleep 1
done

R:0 / I:0 / P:2 [R] [G] [-]

VPN + Tor Browser

This thread will quickly explain how to use the Tor Browser after connecting to a VPN.

1. Read this thread first so you'll configure IPTables properly: https://8ch.net/slackware/res/10.html

2. $ cd $HOME/tor-browser_en-US/Browser/TorBrowser/Data/Tor/ (or wherever the Tor Browser is installed)

3. $ cp torrc torrc.orig (make a backup of torrc)

4. $ /sbin/ip -c a (check which ip address the VPN interface is using; the network interface should be tun0 in most cases, so check the ip address right after "inet" from the tun0 interface)

5. Add to the bottom of torrc "OutboundBindAddress 127.0.0.1" (without the quotes and replace 127.0.0.1 with the ip address obtained from step #4).

6. Run Tor Browser.

7. # ss -utapn | grep -i tor (yes, do this as root or use sudo; verify that "OutboundBindAddress" is listed, and that it is connected to the "Guard" by looking at the Tor Circuit List; go to https://check.torproject.org/ and click on the green padlock)

R:0 / I:0 / P:2 [R] [G] [-]

GnuPG Tips

In this thread, I'll be giving some tips on GnuPG. I will not be explaining the basic commands, but rather giving out a few useful commands that I use every now and then. As time goes by I'll be adding more tips.

1. Always create a strong password. Preferably use a passphrase as long as you can remember it. A long passphrase is very important. If anyone ever manages to access your private key, the longer the passphrase the safer it is. If you lose your passphrase, you'll lose access to your private key and everything that has been encrypted with it, so be careful.

Want a passphrase example? OK: "Th3 l1ttl3 r3d riding H00d @t3 Some w0lf m3@t". Mix lower and uppercase letters, numbers and symbols.

2. How to create a password wallet:

After you have successfully created your own private key with GnuPG, one of the things I use the most is a text file containing my various passwords, protected with GnuPG.

Encrypt: $ gpg -r compass -o password.gpg -e password.txt (-r means "id name"; -o means output file; -e means file to encrypt)

Decrypt: $ gpg -d password.gpg | grep -i google (this command will decrypt password.gpg to your screen; grep -i will filter the output so only the line containing "google" will be shown; this helps to filter what you want in case password.txt is big)

Once this is done, you can upload multiple copies of your password.gpg file to anywhere you want. It will be safe as long as you keep your private key and passphrase safe.

3. How to verify multiple .asc files in one go:

$ gpg –verify-files *.asc

4. And don't forget: https://www.gnupg.org/faq/gnupg-faq.html

R:0 / I:0 / P:2 [R] [G] [-]

Configuring sudo (/etc/sudoers)

To make it possible for you to use sudo, you need to add your username(s) to /etc/sudoers. As root, do:

# visudo

visudo is the recommended way to edit /etc/sudoers. You should not use anything else. If you're not familiar with vi, you might have issues editing /etc/sudoers. Check the internet for the basic visual and ex command modes.

Add below the line "root ALL=(ALL) ALL" something like this "username ALL=(ALL) ALL", so it looks likes this:

root ALL=(ALL) ALL

username ALL=(ALL) ALL

Now username can use sudo.

The next thing to do is to uncomment (remove the #) from the line '# Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"' so it looks like this:

Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

Then save and exit (:x).

That will allow username to use sudo without typing the full path for the commands.

I haven't edited anything else, but feel free to read and edit /etc/sudoers as you require.

R:0 / I:0 / P:2 [R] [G] [-]

LibreOffice 6 Manual Installation

For those interested in installing LibreOffice 6 RPM binary by hand, read on. An alternative is to use Alien's packages (https://alien.slackbook.org/blog/ - http://www.slackware.com/~alien/slackbuilds/) or compile LibreOffice itself, which should take some time.

I'm using LibreOffice_6.0.2_Linux_x86-64_rpm.tar.gz in this guide, but it should work with any recent version.

$ mv LibreOffice_6.0.2_Linux_x86-64_rpm.tar.gz /tmp

$ cd /tmp

$ tar zxf LibreOffice_6.0.2_Linux_x86-64_rpm.tar.gz

$ cd LibreOffice_6.0.2.1_Linux_x86-64_rpm/RPMS/

$ sudo rpm2tgz -c '*.rpm'

If sudo or rpm2tgz aren't found in your $PATH, just use the complete path to those commands.

$ rm *.rpm

The RPM's aren't needed anymore

$ /sbin/explodepkg *.tgz

$ cd opt/ && ls

$ mv libreoffice6.0 /opt

$ cd opt/ && ls

$ sudo chown -R root:root libreoffice6.0

Now you can symlink to soffice (I use /opt/libreoffice6.0/program/soffice).

R:0 / I:0 / P:2 [R] [G] [-]

XTerm tips + themes

In this thread I'm going to be sharing some XTerm (https://invisible-island.net/xterm/) tips and themes (that I have and online).

Tip #1: XTerm has fours menus. mainMenu, vtMenu, fontMenu and tekMenu. The most useful ones are the first three. For mainMenu, use Ctrl + Left Mouse button. For vtMenu, use Ctrl + Middle Mouse button. For fontMenu, use Ctrl + Right Mouse button.

Tip #2: XTerm is capable of displaying 256 colours. Download the "256colors2.pl" script from the following link and read the instructions. http://web.archive.org/web/20130125000058/http://frexx.de/xterm-256-notes/

Or read this thread (https://sys.8ch.net/mod.php?/slackware/res/34.html).

Tip #3: Through the file $HOME/.Xresources you are able to configure various X.org programs, including XTerm colours and fonts. Once you have edited $HOME/.Xresources to your liking, do "$ xrdb ~/.Xresources". The changes will take effect in the next XTerm that you open.

My current $HOME/.Xresources looks like this:

$ cat ~/.Xresources

xterm*termName: xterm

xterm*font: 6x13

xterm*faceName: 6x13

xterm*faceSize: 10

xterm*saveLines: 4096

xterm*cursorBlink: true

xterm*cursorOffTime: 300

xterm*cursorOnTime: 300

xterm*cursorUnderLine: true

xterm*dynamicColors: true

xterm*utf8: 0

xterm*fastScroll: true

xterm*Background: #000000

xterm*Foreground: #FFFFFF

xterm*metaSendsEscape: true

Xft.antialias: 1

Xft.autohint: 0

Xft.dpi: 96

Xft.hinting: 0

Xft.hintstyle: hintfull

Xft.lcdfilter: lcddefault

Xft.rgba: rgb

Notice the many xterm* options. You can find those and more in XTerm's man page.

Tip #4: You can configure the look of XTerm by using themes. I'm currently not using any particular theme, but you can find some examples here: https://web.archive.org/web/20090130061234/http://phraktured.net/terminal-colors/

To try a XTerm theme (in this case /tmp/xterm_01), add a line like this to $HOME/.Xresources: "#include "/tmp/xterm_01", so my $HOME/.Xresources would look like this below.

$ cat .Xresources

#include "/tmp/xterm_01"

xterm*termName: xterm

xterm*font: 6x13

xterm*faceName: 6x13

xterm*faceSize: 10

xterm*saveLines: 4096

xterm*cursorBlink: true

xterm*cursorOffTime: 300

xterm*cursorOnTime: 300

xterm*cursorUnderLine: true

xterm*dynamicColors: true

xterm*utf8: 0

xterm*fastScroll: true

xterm*Background: #000000

xterm*Foreground: #FFFFFF

xterm*metaSendsEscape: true

Xft.antialias: 1

Xft.autohint: 0

Xft.dpi: 96

Xft.hinting: 0

Xft.hintstyle: hintfull

Xft.lcdfilter: lcddefault

Xft.rgba: rgb

Then do "$ xrdb ~/.Xresources" and open a new XTerm. Make sure there are no duplicate lines in $HOME/.Xresources and the theme file that you're using.

Tip #5: I'm going to post all the themes that I have, so this will be a long post. When you create your theme file, ignore the "> 01 <" part.

> 01 <

!Theme One

xterm*background: rgb:00/00/00

xterm*foreground: rgb:a8/a8/a8

xterm*color0: rgb:00/00/00

xterm*color1: rgb:a8/00/00

xterm*color2: rgb:00/a8/00

xterm*color3: rgb:a8/54/00

xterm*color4: rgb:00/00/a8

xterm*color5: rgb:a8/00/a8

xterm*color6: rgb:00/a8/a8

xterm*color7: rgb:a8/a8/a8

xterm*color8: rgb:54/50/54

xterm*color9: rgb:f8/54/50

xterm*color10: rgb:50/fc/50

xterm*color11: rgb:f8/fc/50

xterm*color12: rgb:50/54/f8

xterm*color13: rgb:f8/54/f8

xterm*color14: rgb:50/fc/f8

xterm*color15: rgb:f8/fc/f8

> 02 <

!Theme Two

xterm*background: rgb:00/00/00

xterm*foreground: rgb:7f/7f/7f

xterm*color0: rgb:00/00/00

xterm*color1: rgb:9e/18/28

xterm*color2: rgb:ae/ce/92

xterm*color3: rgb:96/8a/38

xterm*color4: rgb:41/41/71

xterm*color5: rgb:96/3c/59

xterm*color6: rgb:41/81/79

xterm*color7: rgb:be/be/be

xterm*color8: rgb:66/66/66

xterm*color9: rgb:cf/61/71

xterm*color10: rgb:c5/f7/79

xterm*color11: rgb:ff/f7/96

xterm*color12: rgb:41/86/be

xterm*color13: rgb:cf/9e/be

xterm*color14: rgb:71/be/be

xterm*color15: rgb:ff/ff/ff

> 03 <

!Theme Three

xterm*background: rgb:00/00/00

xterm*foreground: rgb:cf/cf/cf

xterm*color0: rgb:00/00/00

xterm*color1: rgb:e0/10/10

xterm*color2: rgb:20/ad/20

xterm*color3: rgb:d4/c2/4f

xterm*color4: rgb:23/1b/b8

xterm*color5: rgb:9c/38/85

xterm*color6: rgb:1d/bd/b8

xterm*color7: rgb:fe/fe/fe

xterm*color8: rgb:6a/6a/6a

xterm*color9: rgb:e8/3a/3d

xterm*color10: rgb:35/e9/56

xterm*color11: rgb:ff/ff/2f

xterm*color12: rgb:3a/53/f0

xterm*color13: rgb:e6/28/ba

xterm*color14: rgb:1c/f5/f5

xterm*color15: rgb:ff/ff/ff

> 04 <

!Theme Four

xterm*background: rgb:00/00/00

xterm*foreground: rgb:ff/ff/ff

xterm*color0: rgb:00/00/00

xterm*color1: rgb:d3/62/65

xterm*color2: rgb:ae/ce/91

xterm*color3: rgb:e7/e1/8c

xterm*color4: rgb:7a/7a/b0

xterm*color5: rgb:96/3c/59

xterm*color6: rgb:41/81/79

xterm*color7: rgb:be/be/be

xterm*color8: rgb:66/66/66

xterm*color9: rgb:ef/81/71

xterm*color10: rgb:e5/f7/79

xterm*color11: rgb:ff/f7/96

xterm*color12: rgb:41/86/be

xterm*color13: rgb:ef/9e/be

xterm*color14: rgb:71/be/be

xterm*color15: rgb:ff/ff/ff

> 05 <

!Theme Five

xterm*background: rgb:ad/aa/ad

xterm*foreground: rgb:00/00/00

xterm*color0: rgb:00/00/00

xterm*color1: rgb:64/0f/19

xterm*color2: rgb:63/79/6b

xterm*color3: rgb:ad/71/42

xterm*color4: rgb:4f/4f/89

xterm*color5: rgb:b2/5c/7c

xterm*color6: rgb:52/75/6b

xterm*color7: rgb:ad/aa/ad

xterm*color8: rgb:52/55/52

xterm*color9: rgb:a5/61/63

xterm*color10: rgb:ce/c2/63

xterm*color11: rgb:73/ae/70

xterm*color12: rgb:36/70/9f

xterm*color13: rgb:aa/82/9c

xterm*color14: rgb:51/89/89

xterm*color15: rgb:ff/ff/ef

> 06 <

!Theme Six

xterm*background: rgb:be/be/be

xterm*foreground: rgb:21/21/21

xterm*color0: rgb:00/00/00

xterm*color1: rgb:bf/72/76

xterm*color2: rgb:86/af/80

xterm*color3: rgb:96/8a/38

xterm*color4: rgb:36/73/b5

xterm*color5: rgb:9a/70/b2

xterm*color6: rgb:7a/be/cc

xterm*color7: rgb:db/db/db

xterm*color8: rgb:66/92/af

xterm*color9: rgb:e5/50/5f

xterm*color10: rgb:87/bc/87

xterm*color11: rgb:e0/d9/5c

xterm*color12: rgb:1b/85/d6

xterm*color13: rgb:ad/73/ba

xterm*color14: rgb:33/8e/aa

xterm*color15: rgb:f4/f4/f4

> 07 <

!Theme Seven

xterm*background: rgb:67/67/67

xterm*foreground: rgb:ff/ff/ff

xterm*color0: rgb:00/00/00

xterm*color1: rgb:bf/46/46

xterm*color2: rgb:67/b2/5f

xterm*color3: rgb:cf/c4/4e

xterm*color4: rgb:51/60/83

xterm*color5: rgb:ca/6e/ff

xterm*color6: rgb:92/b2/f8

xterm*color7: rgb:d5/d5/d5

xterm*color8: rgb:00/00/00

xterm*color9: rgb:f4/8a/8a

xterm*color10: rgb:a5/d7/9f

xterm*color11: rgb:e1/da/84

xterm*color12: rgb:a2/bb/ff

xterm*color13: rgb:e2/b0/ff

xterm*color14: rgb:ba/cd/f8

xterm*color15: rgb:d5/d5/d5

> 08 <

!Theme Eight

xterm*background: rgb:10/10/10

xterm*foreground: rgb:d3/d3/d3

xterm*color0: rgb:10/10/10

xterm*color1: rgb:cd/5c/5c

xterm*color2: rgb:2e/8b/57

xterm*color3: rgb:f0/e6/8c

xterm*color4: rgb:b0/c4/de

xterm*color5: rgb:ba/55/d3

xterm*color6: rgb:46/82/b4

xterm*color7: rgb:d3/d3/d3

xterm*color8: rgb:4d/4d/4d

xterm*color9: rgb:ff/6a/6a

xterm*color10: rgb:8f/bc/8f

xterm*color11: rgb:ff/fa/cd

xterm*color12: rgb:1e/90/ff

xterm*color13: rgb:db/70/93

xterm*color14: rgb:5f/9e/a0

xterm*color15: rgb:ff/ff/ff

> 09 <

!Theme Nine

xterm*background: rgb:1a/1a/1a

xterm*foreground: rgb:d6/d6/d6

xterm*color0: rgb:00/00/00

xterm*color1: rgb:9e/18/28

xterm*color2: rgb:00/88/00

xterm*color3: rgb:96/8a/38

xterm*color4: rgb:41/41/71

xterm*color5: rgb:96/3c/59

xterm*color6: rgb:41/81/79

xterm*color7: rgb:be/be/be

xterm*color8: rgb:66/66/66

xterm*color9: rgb:cf/61/71

xterm*color10 rgb:7c/bc/8c

xterm*color11 rgb:ff/f7/96

xterm*color12 rgb:41/86/be

xterm*color13 rgb:cf/9e/be

xterm*color14 rgb:71/be/be

xterm*color15: rgb:ff/ff/ff

> 10 <

!Theme Ten

xterm*background: rgb:1a/1a/1a

xterm*foreground: rgb:d6/d6/d6

xterm*color0: rgb:00/00/00

xterm*color1: rgb:98/56/5e

xterm*color2: rgb:66/82/5d

xterm*color3: rgb:96/91/76

xterm*color4: rgb:4d/65/85

xterm*color5: rgb:96/73/95

xterm*color6: rgb:5f/7f/7b

xterm*color7: rgb:b3/b3/b3

xterm*color8: rgb:73/73/73

xterm*color9: rgb:cf/a3/a9

xterm*color10: rgb:ca/f7/bb

xterm*color11: rgb:ff/f8/bc

xterm*color12: rgb:83/a3/be

xterm*color13: rgb:bb/a9/cf

xterm*color14: rgb:96/cc/cc

xterm*color15: rgb:ff/ff/ff

> 11 <

!Theme Eleven

xterm*background: rgb:33/33/33

xterm*foreground: rgb:ff/ff/ff

xterm*color0: rgb:33/33/33

xterm*color8: rgb:33/33/33

xterm*color1: rgb:ff/a0/a0

xterm*color9: rgb:ff/a0/a0

xterm*color2: rgb:98/fb/98

xterm*color10: rgb:9a/cd/32

xterm*color3: rgb:f0/e6/8c

xterm*color11: rgb:f0/e6/8c

xterm*color4: rgb:87/ce/eb

xterm*color12: rgb:87/ce/eb

xterm*color5: rgb:ff/a0/a0

xterm*color13: rgb:ff/a0/a0

xterm*color6: rgb:87/ce/eb

xterm*color14: rgb:87/ce/eb

xterm*color7: rgb:ff/ff/ff

xterm*color15: rgb:ff/ff/ff

> 12 <

!Theme Twelve

xterm*foreground: rgb:ff/ff/ff

xterm*background: rgb:00/00/00

xterm*color0: rgb:00/00/00

xterm*color1: rgb:bf/72/76

xterm*color2: rgb:86/af/80

xterm*color3: rgb:96/8a/38

xterm*color4: rgb:36/73/b5

xterm*color5: rgb:9a/70/b2

xterm*color6: rgb:7a/be/cc

xterm*color7: rgb:db/db/db

xterm*color8: rgb:66/92/af

xterm*color9: rgb:e5/50/5f

xterm*color10: rgb:87/bc/87

xterm*color11: rgb:e0/d9/5c

xterm*color12: rgb:1b/85/d6

xterm*color13: rgb:ad/73/ba

xterm*color14: rgb:33/8e/aa

xterm*color15: rgb:f4/f4/f4

> 13 <

!Theme Thirteen

xterm*background: rgb:00/00/00

xterm*foreground: rgb:aa/aa/aa

xterm*color0: rgb:00/00/00

xterm*color1: rgb:9e/18/28

xterm*color2: rgb:ae/ce/92

xterm*color3: rgb:96/8a/38

xterm*color4: rgb:41/41/71

xterm*color5: rgb:96/3c/59

xterm*color6: rgb:7f/9f/7f

xterm*color7: rgb:be/be/be

xterm*color8: rgb:66/66/66

xterm*color9: rgb:cf/61/71

xterm*color10: rgb:af/c5/af

xterm*color11: rgb:f0/df/af

xterm*color12: rgb:8e/9f/bc

xterm*color13: rgb:dc/a3/a3

xterm*color14: rgb:95/c1/c5

xterm*color15: rgb:ff/ff/ff

> 14 <

!Theme Fourteen

xterm*background: rgb:95/95/95

xterm*foreground: rgb:00/00/00

xterm*color0: rgb:7f/7f/7f

xterm*color1: rgb:cd/00/00

xterm*color2: rgb:00/8b/00

xterm*color3: rgb:ee/ee/00

xterm*color4: rgb:00/00/cd

xterm*color5: rgb:cd/00/cd

xterm*color6: rgb:00/ee/ee

xterm*color7: rgb:fa/eb/d7

xterm*color8: rgb:e5/e5/e5

xterm*color9: rgb:80/00/00

xterm*color10: rgb:00/50/20

xterm*color11: rgb:99/55/00

xterm*color12: rgb:00/40/80

xterm*color13: rgb:44/33/00

xterm*color14: rgb:30/60/80

xterm*color15: rgb:ff/ff/ff

> 15 <

!Theme Fifteen

xterm*background: rgb:1d/2b/3a

xterm*foreground: rgb:be/be/be

xterm*color0: rgb:00/00/00

xterm*color1: rgb:d3/62/65

xterm*color2: rgb:ae/ce/91

xterm*color3: rgb:e7/e1/8c

xterm*color4: rgb:7a/7a/b0

xterm*color5: rgb:96/3c/59

xterm*color6: rgb:41/81/79

xterm*color7: rgb:be/be/be

xterm*color8: rgb:66/66/66

xterm*color9: rgb:ef/81/71

xterm*color10: rgb:e5/f7/79

xterm*color11: rgb:ff/f7/99

xterm*color12: rgb:41/86/be

xterm*color13: rgb:ef/9e/be

xterm*color14: rgb:71/be/be

xterm*color15: rgb:ff/ff/ff

> 16 <

!Theme Sixteen

xterm*background: rgb:00/00/00

xterm*foreground: rgb:be/be/be

xterm*color0: rgb:00/00/00

xterm*color1: rgb:9e/18/28

xterm*color2: rgb:ae/ce/92

xterm*color3: rgb:96/8a/38

xterm*color4: rgb:41/41/71

xterm*color5: rgb:96/3c/59

xterm*color6: rgb:41/81/79

xterm*color7: rgb:be/be/be

xterm*color8: rgb:66/66/66

xterm*color9: rgb:cf/61/71

xterm*color10: rgb:c5/f7/79

xterm*color11: rgb:ff/f7/96

xterm*color12: rgb:41/86/be

xterm*color13: rgb:cf/9e/be

xterm*color14: rgb:71/be/be

xterm*color15: rgb:ff/ff/ff

> 17 <

!Theme Seventeen

xterm*background: rgb:00/00/00

xterm*foreground: rgb:e5/e5/e5

xterm*color0: rgb:00/00/00

xterm*color1: rgb:ff/00/00

xterm*color2: rgb:00/ff/00

xterm*color3: rgb:ff/ff/00

xterm*color4: rgb:00/00/ff

xterm*color5: rgb:ff/00/ff

xterm*color6: rgb:00/ff/ff

xterm*color7: rgb:ff/ff/ff

xterm*color8: rgb:ff/d3/9b

xterm*color9: rgb:ff/82/47

xterm*color10: rgb:ff/82/ab

xterm*color11: rgb:87/ce/fa

xterm*color12: rgb:ff/ff/ff

xterm*color13: rgb:ff/ff/ff

xterm*color14: rgb:ff/ff/ff

xterm*color15: rgb:ff/ff/ff

> 18 <

!Theme Eighteen

xterm*color0: rgb:00/00/00

xterm*color1: rgb:9e/18/28

xterm*color2: rgb:5c/b2/47

xterm*color3: rgb:96/8a/38

xterm*color4: rgb:41/61/a0

xterm*color5: rgb:9b/76/8e

xterm*color6: rgb:41/91/89

xterm*color7: rgb:be/be/be

xterm*color8: rgb:66/66/66

xterm*color9: rgb:cf/61/71

xterm*color10: rgb:c5/f7/79

xterm*color11: rgb:ff/f7/96

xterm*color12: rgb:41/86/be

xterm*color13: rgb:cf/9e/be

xterm*color14: rgb:71/be/be

xterm*color15: rgb:dd/dd/dd

> 19 <

!Theme Nineteen

xterm*color0: rgb:00/00/00

xterm*color1: rgb:b0/70/50

xterm*color2: rgb:12/91/4e

xterm*color3: rgb:a0/a0/70

xterm*color4: rgb:3e/45/81

xterm*color5: rgb:a0/70/a0

xterm*color6: rgb:70/a0/a0

xterm*color7: rgb:a0/a0/a0

xterm*color8: rgb:60/60/60

xterm*color9: rgb:b0/70/50

xterm*color10: rgb:12/91/4e

xterm*color11: rgb:c0/c0/90

xterm*color12: rgb:3e/45/81

xterm*color13: rgb:c0/90/c0

xterm*color14: rgb:90/c0/c0

xterm*color15: rgb:ff/ff/ff

> 20 <

!Theme Twenty

xterm*foreground: rgb:aa/aa/aa

xterm*background: rgb:00/00/00

xterm*color0: rgb:30/34/30

xterm*color1: rgb:bf/79/79

xterm*color2: rgb:97/b2/6b

xterm*color3: rgb:cd/cd/c1

xterm*color4: rgb:86/a2/be

xterm*color5: rgb:d9/b7/98

xterm*color6: rgb:a1/b5/cd

xterm*color7: rgb:ff/ff/ff

xterm*color8: rgb:cd/b5/cd

xterm*color9: rgb:f4/a4/5f

xterm*color10: rgb:c5/f7/79

xterm*color11: rgb:ff/ff/ef

xterm*color12: rgb:98/af/d9

xterm*color13: rgb:d7/d9/98

xterm*color14: rgb:a1/b5/cd

xterm*color15: rgb:de/de/de

> 21 <

!Theme Twenty-One

xterm*background: rgb:1a/1a/1a

xterm*foreground: rgb:aa/aa/aa

xterm*color0: rgb:00/00/00

xterm*color8: rgb:66/66/66

xterm*color1: rgb:9e/18/28

xterm*color9: rgb:bc/57/66

xterm*color2: rgb:00/88/00

xterm*color10: rgb:61/a1/71

xterm*color3: rgb:d2/bb/4b

xterm*color11: rgb:e7/db/52

xterm*color4: rgb:41/41/71

xterm*color12: rgb:50/85/af

xterm*color5: rgb:96/3c/59

xterm*color13: rgb:a9/7a/99

xterm*color6: rgb:41/81/79

xterm*color14: rgb:6b/a4/a4

xterm*color7: rgb:be/be/be

xterm*color15: rgb:ff/ff/ff

> 22 <

!Theme Twenty-Two

xterm*background: rgb:00/00/00

xterm*foreground: rgb:be/be/be

xterm*color0: rgb:00/00/00

xterm*color1: rgb:d3/62/65

xterm*color2: rgb:ae/ce/91

xterm*color3: rgb:e7/e1/8c

xterm*color4: rgb:7a/7a/b0

xterm*color5: rgb:96/3c/59

xterm*color6: rgb:7f/9f/7f

xterm*color7: rgb:be/be/be

xterm*color8: rgb:66/66/66

xterm*color9: rgb:ef/81/71

xterm*color10: rgb:e5/f7/79

xterm*color11: rgb:f0/df/af

xterm*color12: rgb:8e/9f/bc

xterm*color13: rgb:ef/9e/be

xterm*color14: rgb:71/be/be

xterm*color15: rgb:ff/ff/ff

> 23 <

!Theme Twenty-Three

xterm*background: rgb:0e/0e/0e

xterm*foreground: rgb:4a/d5/e1

xterm*color0: rgb:00/00/00

xterm*color1: rgb:dc/74/d1

xterm*color2: rgb:0e/b8/c7

xterm*color3: rgb:df/e3/7e

!xterm*color4: ???

xterm*color5: rgb:9e/88/f0

xterm*color6: rgb:73/f7/ff

xterm*color7: rgb:e1/dd/dd

xterm*color8: rgb:8b/8f/93

xterm*color9: rgb:dc/74/d1

xterm*color10: rgb:0e/b8/c7

xterm*color11: rgb:df/e3/7e

xterm*color13: rgb:9e/88/f0

xterm*color14: rgb:73/f7/ff

xterm*color15: rgb:e1/dd/dd

> 24 <

!Theme Twenty-Four

xterm*color0: rgb:00/00/00

xterm*color1: rgb:cd/5c/5c

xterm*color2: rgb:8e/ae/71

xterm*color3: rgb:d2/b4/8c

xterm*color4: rgb:5f/7b/8a

xterm*color5: rgb:cd/cd/b4

xterm*color6: rgb:68/68/68

xterm*color7: rgb:ff/ff/ff

xterm*color8: rgb:00/00/00

xterm*color9: rgb:ee/63/63

xterm*color10: rgb:95/c7/49

xterm*color11: rgb:cd/cd/c1

xterm*color12: rgb:6b/7b/8a

xterm*color13: rgb:cd/cd/b4

xterm*color14: rgb:77/87/98

xterm*color15: rgb:ca/ca/ca

> 25 <

Theme Twenty-Five

xterm*color0: rgb:00/00/00

xterm*color1: rgb:80/00/00

xterm*color2: rgb:00/80/00

xterm*color3: rgb:d0/d0/90

xterm*color4: rgb:00/00/80

xterm*color5: rgb:80/00/80

xterm*color6: rgb:a6/ca/f0

xterm*color7: rgb:d0/d0/d0

xterm*color8: rgb:b0/b0/b0

xterm*color9: rgb:f0/80/60

xterm*color10: rgb:60/f0/80

xterm*color11: rgb:e0/c0/60

xterm*color12: rgb:80/c0/e0

xterm*color13: rgb:f0/c0/f0

xterm*color14: rgb:c0/d8/f8

xterm*color15: rgb:e0/e0/e0

> astromouse <

xterm*color0: #1c1c1c

xterm*color8: #3d3a3a

xterm*color1: #d770af

xterm*color9: #d28abf

xterm*color2 : #9acc79

xterm*color10: #8fb676

xterm*color3: #d0d26b

xterm*color11: #c8bc45

xterm*color4 : #77b6c5

xterm*color12: #8fa7b9

xterm*color5: #a488d9

xterm*color13: #bd89de

xterm*color6: #7fcab3

xterm*color14: #6ec2a8

xterm*color7: #8d8d8d

xterm*color15: #dad3d3

> belge <

!black

xterm*color0: #252525

xterm*color8: #454545

!red

xterm*color1: #EF6769

xterm*color9: #FC7CA5

!green

xterm*color2: #A6E22E

xterm*color10: #B6E354

!yellow

xterm*color3: #FD971F

xterm*color11: #FD971F

!blue

xterm*color4: #6495ED

xterm*color12: #87CEEB

!magenta

xterm*color5: #DEB887

xterm*color13: #996600

!cyan

xterm*color6: #B0C4DE

xterm*color14: #87CEEB

!white

xterm*color7: #DBDCDC

xterm*color15: #FDFDFD

> bitmute <

xterm*color0: #282828

xterm*color8: #494949

!red

xterm*color1: #b76969

xterm*color9: #b87e7e

!green

xterm*color2: #719d72

xterm*color10: #839d84

!yellow

xterm*color3: #909858

xterm*color11: #919864

!blue

xterm*color4: #68668f

xterm*color12: #73718f

!magenta

xterm*color5: #966894

xterm*color13: #987397

!cyan

xterm*color6: #688891

xterm*color14: #758c93

!white

xterm*color7: #8e8e8e

xterm*color15: #aeaeae

> bleh1 <

!BLACK

xterm*color0: #666666

xterm*color8: #8c847f

!RED

xterm*color1: #996578

xterm*color9: #bd4b76

!GREEN

xterm*color2: #889965

xterm*color10: #95b548

!YELLOW

xterm*color3: #998565

xterm*color11: #bd814b

!BLUE

xterm*color4: #657a99

xterm*color12: #4c83bf

!MAGENTA

xterm*color5: #8b6599

xterm*color13: #a04bbd

!CYAN

xterm*color6: #65998d

xterm*color14: #4dbda8

!WHITE

xterm*color7: #a5a5a4

xterm*color15: #848484

> deafened <

xterm*color0: #3d3e3d

xterm*color8: #5a5b5c

xterm*color1: #755a5b

xterm*color9: #a37679

xterm*color2: #68755a

xterm*color10: #87a376

xterm*color3: #756e5a

xterm*color11: #a39b76

xterm*color4: #5b6976

xterm*color12: #758ba3

xterm*color5: #755b76

xterm*color13: #9f76a3

xterm*color6: #465457

xterm*color14: #899ca1

xterm*color7: #ccccc6

xterm*color15: #f8f8f2

> digerati <

! Black

xterm*color0: #303030

xterm*color8: #5F5F5F

! Red

xterm*color1: #c03000

xterm*color9: #FF3A78

! Green

xterm*color2: #b1d631

xterm*color10: #A6CD07

! Yellow

xterm*color3: #fecf35

xterm*color11: #B5C865

! Blue

xterm*color4: #426870

xterm*color12: #4A7781

! Magenta

xterm*color5: #6D506D

xterm*color13: #FF3B77

! Cyan

xterm*color6: #4bb5c1

xterm*color14: #4bb5c1

! White

xterm*color7: #e2e2e5

xterm*color15: #e2e2e5

! vim: et sw=2 syn=xdefaults

> dwmrob <

! Black

xterm*color0: #151515

xterm*color8: #505450

! Red

xterm*color1: #bf7979

xterm*color9: #f4a45f

! Green

xterm*color2: #97b26b

xterm*color10: #c5f779

! Yellow

xterm*color3: #cdcda1

xterm*color11: #ffffaf

! Blue

xterm*color4: #4a5463

xterm*color12: #7d8794

! Magneta

xterm*color5: #9c3885

xterm*color13: #e628ba

! Cyan

xterm*color6: #88aadd

xterm*color14: #99ccff

! White

xterm*color7: #ffffff

xterm*color15: #dedede

! vim: et sw=2 syn=xdefaults

> epiphany <

!black

xterm*color8: #656565

xterm*color0: #565656

!red

xterm*color1: #AC4F4F

xterm*color9: #E85555

!green

xterm*color2: #88AB77

xterm*color10: #8CCD6C

!yellow

xterm*color3: #D0D9AD

xterm*color11: #C5D67D

!blue

xterm*color4: #677088

xterm*color12: #647396

!magenta

xterm*color5: #CDCDB4

xterm*color13: #CDB4C9

!cyan

xterm*color6: #445362

xterm*color14: #505B6C

!white

xterm*color7: #FFFFFF

xterm*color15: #C0C0C0

> erebus <

! black / dark gray

xterm*color0: #757575

xterm*color8: #B8B8B8

! red

xterm*color1: #FF5F5F

xterm*color9: #D78787

! green

xterm*color2: #DE8A36

xterm*color10: #FF9F6F

! yellow

xterm*color3: #D78787

xterm*color11: #FF5F5F

! blue

xterm*color4: #AF5FD7

xterm*color12: #DEA3E5

! magenta

xterm*color5: #FF87D7

xterm*color13: #D7AFAF

! cyan

xterm*color6: #DEA3E5

xterm*color14: #AF5FD7

! light gray / white

xterm*color7: #B8B8B8

xterm*color15: #757575

> fishbone <

!black

xterm*color0:#293b3b

xterm*color8:#344040

!red

xterm*color1:#bf5357

xterm*color9:#bf6367

!green

xterm*color2:#41a551

xterm*color10:#51a55f

!yellow

xterm*color3:#aea64f

xterm*color11:#aea75d

!blue

xterm*color4:#416ea5

xterm*color12:#5177a5

!magenta

xterm*color5:#bf6053

xterm*color13:#bf6e63

!cyan

xterm*color6:#714da5

xterm*color14:#7859a5

!white

xterm*color7:#876868

xterm*color15:#876f6f

> gjm <

! vim: set filetype=xdefaults :

! gjm scheme

! xterm*background: rgba:0000/0000/0000/dddd

xterm*cursorColor: #cee318

xterm*background: #1C1C1C

xterm*foreground: #c5c5c5

! black

xterm*color0: #1C1C1C

xterm*color8: #666666

! red

xterm*color1: #ff005b

xterm*color9: #ff00a0

! green

xterm*color2: #cee318

xterm*color10: #ccff00

! yellow

xterm*color3: #ffe755

xterm*color11: #ff9f00

! blue

xterm*color4: #048ac7

xterm*color12: #48c6ff

! magenta

xterm*color5: #833c9f

xterm*color13: #be67e1

! cyan

xterm*color6: #0ac1cd

xterm*color14: #63e7f0

! white

xterm*color7: #e5e5e5

xterm*color15: #f3f3f3

> grandshell <

! grandshell color scheme

! based on steckerhalter (grandshell-theme for emacs).

! https://github.com/steckerhalter/grandshell-theme

xterm*background: #000000

xterm*foreground: #bebebe

xterm*cursorColor: #aa2255

! black + red

xterm*color0: #000000

xterm*color1: #f25a5a

! green + yellow

xterm*color2: #77bb33

xterm*color3: #efc334

! blue + purple

xterm*color4: #5555dd

xterm*color5: #C350FF

! cyan + white

xterm*color6: #5af2ee

xterm*color7: #bebebe

! bright-black + bright-red

xterm*color8: #222222

xterm*color9: #ffbbbb

! bright-green + bright-yellow

xterm*color10: #dcf692

xterm*color11: #f6df92

! bright-blue + bright-purple

xterm*color12: #b2baf6

xterm*color13: #f09fff

! bright-cyan + bright-white

xterm*color14: #5af2ee

xterm*color15: #eeeeee

> hybrid <

!black

xterm*color0: #393939

xterm*color8: #474747

!red

xterm*color1: #da4939

xterm*color9: #ff6c5c

!green

xterm*color2 : #9acc79

xterm*color10: #8fb676

!yellow

xterm*color3: #d0d26b

xterm*color11: #c8bc45

!blue

xterm*color4: #6d9cbe

xterm*color12: #d0d0ff

!magenta

xterm*color5: #9f5079

xterm*color13: #a761c2

!cyan

xterm*color6: #435d75

xterm*color14: #6e98a4

!white

xterm*color7: #c2c2c2

xterm*color15: #c2c2c2

> insignificato <

!Black

xterm*color0: #3d3e3d

xterm*color8: #5a5b5c

!Red

xterm*color1: #755a5b

xterm*color9: #a37679

!Green

xterm*color2: #68755a

xterm*color10: #87a376

!Yellow

xterm*color3: #756e5a

xterm*color11: #a39b76

!Blue

xterm*color4: #5b6976

xterm*color12: #758ba3

!Magenta

xterm*color5: #755b76

xterm*color13: #9f76a3

!Cyan

xterm*color6: #5b7674

xterm*color14: #75a3a1

!White

xterm*color7: #808080

xterm*color15: #aeafb0

> jwrdark <

!###### Color list ###################

!## B2FBA4 C3ECE9 Green ###

!## FBA4A8 a3c5e7 5d7caf Blue ###

!## ff6ffa 5F8BFF 490a47 1f0042 ###

!#####################################

! Black

xterm*color0: #333333

xterm*color8: #3D3D3D

! Red

xterm*color1: #8C4665

xterm*color9: #BF4D80

! Green

xterm*color2: #287373

xterm*color10: #53A6A6

! Yellow

xterm*color3: #7C7C99

xterm*color11: #9E9ECB

! Blue

xterm*color4: #395573

xterm*color12: #477AB3

! Magneta

xterm*color5: #5E468C

xterm*color13: #7E62B3

! Cyan

xterm*color6: #31658C

xterm*color14: #6096BF

! White

xterm*color7: #899CA1

xterm*color15: #C0C0C0

! vim: et sw=2 syn=xdefaults

> mikado <

! mikado colors

!black

xterm*color0: #322a2c

xterm*color8: #46423b

!red

xterm*color1: #a04363

xterm*color9: #ae837a

!green

xterm*color2: #9b9329

xterm*color10: #b4aa30

!yellow

!xterm*color3: #c77920

xterm*color3: #bf7a29

xterm*color11: #c7a551

!blue

xterm*color4: #6a8c8c

xterm*color12: #74999e

!magenta

xterm*color5: #856774

xterm*color13: #9c818e

!cyan

xterm*color6: #757978

xterm*color14: #9fa590

!white

xterm*color7: #bcbcaf

xterm*color15: #c1c4bc

> monotheme <

!el_k gslob re-write

!MONOSCHEME

!BLACK

xterm*color0: #000000

xterm*color8: #202020

!RED

xterm*color1: #6b6b6b

xterm*color9: #464646

!GREEN

xterm*color2: #C4C4C4

xterm*color10: #F8F8F8

!YELLOW

xterm*color3: #b3b3b3

xterm*color11: #EEEEEE

!BLUE

xterm*color4: #999999

xterm*color12: #7c7c7c

!MAGENTA

xterm*color5: #717171

xterm*color13: #adadad

!CYAN

xterm*color6: #8A8A8A

xterm*color14: #C0C0C0

!WHITE

xterm*color7: #b5cabb

xterm*color15: #99ac9e

> nancy <

/* vim: ft=xdefaults:

What: nancy.Xresources

Where: $XDG_CONFIG_HOME/Xcolors/nancy.Xresources

Who: Magnus Woldrich <m@japh.se>

Created: 2008-04-24

Updated: 2012-06-16

URL: http://github.com/trapd00r/configs/blob/master/Xcolors

http://devel.japh.se/nancy/nancy.png

Usage: Include this file from your main X resource file:

#include <path>/nancy.Xresources

This X resource file redefines not only the standard ANSI colors but also

some of the extended ones (52, 85-88, 231 as of this writing).

It will work with any xterm-compatible terminal. If you're using xterm,

depending on your setup, you might have to enable one or the other or both

of the following resources:

allowColorOps

dynamicColors

Either way, it'll be a good idea to enable both because it's definitely a

must when you're going to play with the utilities and libraries described

below.

urxvt doesn't support redefining of anything but ANSI colors, but I have

patched [0] her to allow for modification of the full 256 color table.

If you'd want to create your own colorschemes, or if you need to set colors

for the current terminal session only, thus not making the changes persistent,

take a look at colorcoke [1] and its wiki entry [2].

If you're a developer you'll find Term::ExtendedColor::Xresources [3]

useful.

You can query the terminal for the current color values, see [3] and

rgbterm [4].

For trying out colorschemes quickly, or for inclusion in other scripts, the

xcolor [5] utility might prove useful.

It's basically ttycolor [6] for X, requested by a user.

There's a bunch of example scripts using colorcoke in the scripts/ [7]

directory (matrix!).

[0]: http://github.com/trapd00r/rxvt-unicode

[1]: http://github.com/trapd00r/colorcoke

[2]: http://github.com/trapd00r/colorcoke/wiki

[3]: http://github.com/trapd00r/Term-ExtendedColor-Xresources

[4]: http://github.com/trapd00r/rgbterm

[5]: http://github.com/trapd00r/Term-ExtendedColor-Xresources/blob/master/bin/xcolor

[6]: http://github.com/trapd00r/ttycolor

[7]: http://github.com/trapd00r/colorcoke/tree/master/scripts

*/

*foreground: #fff

*background: #010101

*colorBD: #7e6449

*colorIT: #7c7e49

*colorRV: #121212

*colorUL: #ff8f00

*fadeColor: #000016

*borderColor: #1b1d1e

*underlineColor: #de5105

*cursorColor: #e5e5e5

*cursorColor2: #201526

*pointerColor: #252525

*pointerColor2: #201526

*color0: #1b1d1e

*color1: #f92672

*color2: #82b414

*color3: #fd971f

*color4: #4e82aa

*color5: #8c54fe

*color6: #465457

*color7: #ccccc6

*color8: #505354

*color9: #ff5995

*color10: #b6e354

*color11: #feed6c

*color12: #0c73c2

*color13: #9e6ffe

*color14: #899ca1

*color15: #f8f8f2

*color16: #000000

*color17: #00005f

*color18: #000087

*color19: #0000af

*color20: #0000d7

*color21: #0000ff

*color22: #005f00

*color23: #005f5f

*color24: #005f87

*color25: #005faf

*color26: #005fd7

*color27: #005fff

*color28: #008700

*color29: #00875f

*color30: #008787

*color31: #0087af

*color32: #0087d7

*color33: #0087ff

*color34: #00af00

*color35: #00af5f

*color36: #00af87

*color37: #00afaf

*color38: #00afd7

*color39: #00afff

*color40: #00d700

*color41: #00d75f

*color42: #00d787

*color43: #00d7af

*color44: #00d7d7

*color45: #00d7ff

*color46: #00ff00

*color47: #00ff5f

*color48: #00ff87

*color49: #00ffaf

*color50: #00ffd7

*color51: #00ffff

*color52: #131324

*color53: #5f005f

*color54: #5f0087

*color55: #5f00af

*color56: #5f00d7

*color57: #5f00ff

*color58: #5f5f00

*color59: #5f5f5f

*color60: #5f5f87

*color61: #5f5faf

*color62: #5f5fd7

*color63: #5f5fff

*color64: #5f8700

*color65: #5f875f

*color66: #5f8787

*color67: #5f87af

*color68: #5f87d7

*color69: #5f87ff

*color70: #5faf00

*color71: #5faf5f

*color72: #5faf87

*color73: #5fafaf

*color74: #5fafd7

*color75: #5fafff

*color76: #5fd700

*color77: #5fd75f

*color78: #5fd787

*color79: #5fd7af

*color80: #5fd7d7

*color81: #5fd7ff

*color82: #5fff00

*color83: #5fff5f

*color84: #5fff87

*color85: #a03040

*color86: #565941

*color87: #594459

*color88: #009bff

*color89: #87005f

*color90: #870087

*color91: #8700af

*color92: #8700d7

*color93: #8700ff

*color94: #875f00

*color95: #875f5f

*color96: #875f87

*color97: #875faf

*color98: #875fd7

*color99: #875fff

*color100: #878700

*color101: #87875f

*color102: #878787

*color103: #8787af

*color104: #8787d7

*color105: #8787ff

*color106: #87af00

*color107: #87af5f

*color108: #87af87

*color109: #87afaf

*color110: #87afd7

*color111: #87afff

*color112: #87d700

*color113: #87d75f

*color114: #87d787

*color115: #87d7af

*color116: #87d7d7

*color117: #87d7ff

*color118: #87ff00

*color119: #87ff5f

*color120: #87ff87

*color121: #87ffaf

*color122: #87ffd7

*color123: #87ffff

*color124: #af0000

*color125: #af005f

*color126: #af0087

*color127: #af00af

*color128: #af00d7

*color129: #af00ff

*color130: #af5f00

*color131: #af5f5f

*color132: #af5f87

*color133: #af5faf

*color134: #af5fd7

*color135: #af5fff

*color136: #af8700

*color137: #af875f

*color138: #af8787

*color139: #af87af

*color140: #af87d7

*color141: #af87ff

*color142: #afaf00

*color143: #afaf5f

*color144: #afaf87

*color145: #afafaf

*color146: #afafd7

*color147: #afafff

*color148: #afd700

*color149: #afd75f

*color150: #afd787

*color151: #afd7af

*color152: #afd7d7

*color153: #afd7ff

*color154: #afff00

*color155: #afff5f

*color156: #afff87

*color157: #afffaf

*color158: #afffd7

*color159: #afffff

*color160: #d70000

*color161: #d7005f

*color162: #d70087

*color163: #d700af

*color164: #d700d7

*color165: #d700ff

*color166: #d75f00

*color167: #d75f5f

*color168: #d75f87

*color169: #d75faf

*color170: #d75fd7

*color171: #d75fff

*color172: #d78700

*color173: #d7875f

*color174: #d78787

*color175: #d787af

*color176: #d787d7

*color177: #d787ff

*color178: #d7af00

*color179: #d7af5f

*color180: #d7af87

*color181: #d7afaf

*color182: #d7afd7

*color183: #d7afff

*color184: #d7d700

*color185: #ffff00

*color186: #d7d787

*color187: #d7d7af

*color188: #d7d7d7

*color189: #d7d7ff

*color190: #d7ff00

*color191: #d7ff5f

*color192: #d7ff87

*color193: #d7ffaf

*color194: #d7ffd7

*color195: #d7ffff

*color196: #ff0000

*color197: #ff005f

*color198: #ff0087

*color199: #ff00af

*color200: #ff00d7

*color201: #ff00ff

*color202: #ff5f00

*color203: #ff5f5f

*color204: #ff5f87

*color205: #ff5faf

*color206: #ff5fd7

*color207: #ff5fff

*color208: #ff8700

*color209: #ff875f

*color210: #ff8787

*color211: #ff87af

*color212: #ff87d7

*color213: #ff87ff

*color214: #ffaf00

*color215: #ffaf5f

*color216: #ffaf87

*color217: #ffafaf

*color218: #ffafd7

*color219: #ffafff

*color220: #ffd700

*color221: #ffd75f

*color222: #ffd787

*color223: #ffd7af

*color224: #ffd7d7

*color225: #ffd7ff

*color226: #ffff00

*color227: #ffff5f

*color228: #ffff87

*color229: #ffffaf

*color230: #ffffd7

*color231: #060000

*color232: #080808

*color233: #121212

*color234: #1c1c1c

*color235: #262626

*color236: #303030

*color237: #3a3a3a

*color238: #444444

*color239: #4e4e4e

*color240: #585858

*color241: #626262

*color242: #6c6c6c

*color243: #767676

*color244: #808080

*color245: #8a8a8a

*color246: #949494

*color247: #9e9e9e

*color248: #a8a8a8

*color249: #b2b2b2

*color250: #bcbcbc

*color251: #c6c6c6

*color252: #d0d0d0

*color253: #dadada

*color254: #e4e4e4

*color255: #eeeeee

> nudge <

xterm*color0: #658280

xterm*color8: #8ca8a6

!!RED

xterm*color1: #822f5d

xterm*color9: #a24b76

!!GREEN

xterm*color2: #184a31

xterm*color10: #28634d

!!YELLOW

xterm*color3: #9d4500

xterm*color11: #9d5823

!!BLUE

xterm*color4: #304465

xterm*color12: #415c77

!!MAGENTA

xterm*color5: #330801

xterm*color13: #532706

!CYAN

xterm*color6: #175552

xterm*color14: #3a6868

!WHITE

xterm*color7: #110005

xterm*color15: #330801

> parkerbrothers <

! Parker Brothers colors

!black

xterm*color0: #322a2c

xterm*color8: #46423b

!red

xterm*color1: #79220E

xterm*color9: #AA261F

!green

xterm*color2: #344B1B

xterm*color10: #76550F

!yellow

!xterm*color3: #c77920

xterm*color3: #B45B00

xterm*color11: #B57F02

!blue

xterm*color4: #434045

xterm*color12: #908862

!magenta

xterm*color5: #5C1E25

xterm*color13: #624A35

!cyan

xterm*color6: #394745

xterm*color14: #393E38

!white

xterm*color7: #AE8842

xterm*color15: #A59058

> phrak1 <

xterm*background: rgb:00/00/00

xterm*foreground: rgb:a8/a8/a8

! Black

xterm*color0: rgb:00/00/00

xterm*color8: rgb:54/50/54

! Red

xterm*color1: rgb:a8/00/00

xterm*color9: rgb:f8/54/50

! Green

xterm*color2: rgb:00/a8/00

xterm*color10: rgb:50/fc/50

! Yellow

xterm*color3: rgb:a8/54/00

xterm*color11: rgb:f8/fc/50

! Blue

xterm*color4: rgb:00/00/a8

xterm*color12: rgb:50/54/f8

! Magneta

xterm*color5: rgb:a8/00/a8

xterm*color13: rgb:f8/54/f8

! Cyan

xterm*color6: rgb:00/a8/a8

xterm*color14: rgb:50/fc/f8

! White

xterm*color7: rgb:a8/a8/a8

xterm*color15: rgb:f8/fc/f8

! vim: et sw=2 syn=xdefaults

> pulp <

!Black

xterm*color0: #86817e

xterm*color8: #86817e

!Red

xterm*color1: #d75756

xterm*color9: #a63a3a

!Green

xterm*color2: #688c7d

xterm*color10: #688c7d

!Yelllow

xterm*color3: #ffb365

xterm*color11: #ffb365

!Blue

xterm*color4: #68778c

xterm*color12: #68778c

!Magenta

xterm*color5: #fdb3b2

xterm*color13: #8c686a

!Cyan

xterm*color6: #86abd9

xterm*color14: #86abd9

!White

xterm*color7: #f7f8f2

xterm*color15: #f7f8f2

> rydgel <

! Black

xterm*color0: #303430

xterm*color8: #cdb5cd

! Red

xterm*color1: #bf7979

xterm*color9: #f4a45f

! Green

xterm*color2: #97b26b

xterm*color10: #c5f779

! Yellow

xterm*color3: #cdcdc1

xterm*color11: #ffffed

! Blue

xterm*color4: #86a2be

xterm*color12: #98afd9

! Magenta

xterm*color5: #d9b798

xterm*color13: #d7d998

! Cyan

xterm*color6: #a1b5cd

xterm*color14: #a1b5cd

! White

xterm*color7: #ffffff

xterm*color15: #dedede

! vim: et sw=2 syn=xdefaults

> shic <

!black

xterm*color0: #494949

xterm*color8: #484848

!red

xterm*color1: #B9716E

xterm*color9: #8F5A58

!green

xterm*color2: #588F7A

xterm*color10: #326F58

!yellow

xterm*color3: #AAA857

xterm*color11: #C7C575

!blue

xterm*color4: #A0C3C0

xterm*color12: #507F7C

!magenta

xterm*color5: #735E74

xterm*color13: #A387A6

!cyan

xterm*color6: #695935

xterm*color14: #927C4B

!white

xterm*color7: #B1B1B1

xterm*color15: #C7C7C7

> splurge <

!Black

xterm*color0: #4a4b4a

xterm*color8: #696969

!Red

xterm*color1: #D7699A

xterm*color9: #F5A2B5

!Green

xterm*color2: #80D468

xterm*color10: #A3F2A0

!Yellow

xterm*color3: #D7A169

xterm*color11: #F5CDA2

!Blue

xterm*color4: #6985D7

xterm*color12: #A2C1F5

!Magenta

xterm*color5: #C86AD4

xterm*color13: #D2A2F5

!Cyan

xterm*color6: #6FCCD1

xterm*color14: #A0E9F2

!White

xterm*color7: #DBDCDC

xterm*color15: #FDFDFD

> swayr <

! swayr color scheme

xterm*background: #1c1709

xterm*foreground: #c2b9a1

xterm*color0: #1c1709

xterm*color8: #4f4939

xterm*color1: #8e4317

xterm*color9: #f07935

xterm*color2: #787200

xterm*color10: #d9d138

xterm*color3: #945c00

xterm*color11: #ffab26

xterm*color4: #315094

xterm*color12: #8aa9ed

xterm*color5: #5c2e40

xterm*color13: #ff8cb8

xterm*color6: #00617d

xterm*color14: #43bfe0

xterm*color7: #c2b9a1

xterm*color15: #f2e8c9

> tango <

!========

! tango theme

!========

xterm*background: #000000

xterm*foreground: #babdb6

xterm*color0: #2e3436

xterm*color1: #cc0000

xterm*color2: #4e9a06

xterm*color3: #c4a000

xterm*color4: #3465a4

xterm*color5: #75507b

xterm*color6: #06989a

xterm*color7: #d3d7cf

xterm*color8: #555753

xterm*color9: #ef2929

xterm*color10: #8ae234

xterm*color11: #fce94f

xterm*color12: #729fcf

xterm*color13: #ad7fa8

xterm*color14: #34e2e2

xterm*color15: #eeeeec

! vim: ai:si:et:ts=4:sw=4:ft=xdefaults:

> tangoesque <

xterm*background: #000000

xterm*foreground: #aaaaaa

! Black

xterm*color0: #202020

xterm*color8: #606060

! Red

xterm*color1: #ff6565

xterm*color9: #ff8d8d

! Green

xterm*color2: #93d44f

xterm*color10: #c8e7a8

! Yellow

xterm*color3: #eab93d

xterm*color11: #ffc123

! Blue

xterm*color4: #204a87

xterm*color12: #3465a4

! Mangenta

xterm*color5: #ce5c00

xterm*color13: #f57900

! Cyan

xterm*color6: #89b6e2

xterm*color14: #46a4ff

! White

xterm*color7: #cccccc

xterm*color15: #ffffff

> theme2 <

!black

xterm*color0: #191919

xterm*color8: #484848

!red

xterm*color1: #EB3D51

xterm*color9: #BE6262

!green

xterm*color2: #66B61A

xterm*color10: #4B8A10

!yellow

xterm*color3: #D98E1D

xterm*color11: #E5D95E

!blue

xterm*color4: #23FFA8

xterm*color12: #23AAFF

!magenta

xterm*color5: #FF00DA

xterm*color13: #AB005B

!cyan

xterm*color6: #68A783

xterm*color14: #BBCD81

!white

xterm*color7: #EAEAEA

xterm*color15: #BBBBBB

> thwump <

! black + grey

xterm*.color0: #202020

xterm*.color8: #505050

! red

xterm*.color1: #a07070

xterm*.color9: #d07070

! green

xterm*.color2: #70a070

xterm*.color10: #70d070

! yellow

xterm*.color3: #a0a070

xterm*.color11: #d0d070

! blue

xterm*.color4: #7070a0

xterm*.color12: #7070d0

! magenta

xterm*.color5: #a070a0

xterm*.color13: #d070d0

! cyan

xterm*.color6: #70a0a0

xterm*.color14: #70d0d0

! light gray + white

xterm*.color7: #a0a0a0

xterm*.color15: #f0f0f0

> tlh <

xterm*background: #101010

xterm*foreground: #66FF66

!black

xterm*color0: #1c1c1c

xterm*color8: #4d4d4d

!red

xterm*color1: #D81860

xterm*color9: #F00060

!green

xterm*color2: #60FF60

xterm*color10: #70FF70

!yellow

xterm*color3: #f9fd75

xterm*color11: #f9fd80

!blue

xterm*color4: #4695c8

xterm*color12: #5a9dc8

!magenta

xterm*color5: #a78edb

xterm*color13: #b29fdb

!cyan

xterm*color6: #43afce

xterm*color14: #69b8ce

!white

xterm*color7: #f3ebe2

xterm*color15: #eeeeee

> visiblue <

!Gutterslob Visiblue

xterm*background: #000000

xterm*foreground: #666699

!Visiblue

xterm*color0: #333366

xterm*color8: #333399

xterm*color1: #6666CC

xterm*color9: #9999FF

xterm*color2: #0099CC

xterm*color10: #00CCFF

xterm*color3: #3366CC

xterm*color11: #6699FF

xterm*color4: #006699

xterm*color12: #0099CC

xterm*color5: #0066FF

xterm*color13: #0099FF

xterm*color6: #669999

xterm*color14: #66CCCC

xterm*color7: #99CCCC

xterm*color15: #CCFFFF

> visibone <

!BLK

xterm*color0: #666666

xterm*color8: #999999

!RED

xterm*color1: #CC6666

xterm*color9: #FF9999

!GRN

xterm*color2: #66CC99

xterm*color10: #99FFCC

!YEL

xterm*color3: #CC9966

xterm*color11: #FFCC99

!BLE

xterm*color4: #6699CC

xterm*color12: #99CCFF

!MAG

xterm*color5: #CC6699

xterm*color13: #FF99CC

!CYN

xterm*color6: #66CCCC

xterm*color14: #99FFFF

!WHT

xterm*color7: #CCCCCC

xterm*color15: #FFFFFF

> zenburn <

! Zenburn

xterm*color0: #1E2320

xterm*color1: #705050

xterm*color2: #60b48a

xterm*color3: #dfaf8f

xterm*color4: #506070

xterm*color5: #dc8cc3

xterm*color6: #8cd0d3

xterm*color7: #dcdccc

xterm*color8: #709080

xterm*color9: #dca3a3

xterm*color10: #c3bf9f

xterm*color11: #f0dfaf

xterm*color12: #94bff3

xterm*color13: #ec93d3

xterm*color14: #93e0e3

xterm*color15: #ffffff

Enjoy and share your tips or themes!

R:0 / I:0 / P:2 [R] [G] [-]

Slackware creator in strife, claims store has not paid him.

The Slackware Store (https://store.slackware.com/) has apparently been misappropriating funds from Patrick Volkerding.

Donation Links:

https://www.patreon.com/slackwarelinux

or

https://www.paypal.me/volkerdi (post from Patrick Volkerding himself - https://www.linuxquestions.org/questions/slackware-14/donating-to-slackware-4175634729/page11.html#post5883695).

Do not use the Bitcoin address in the post above.

News Links:

https://www.itwire.com/open-source/83757-slackware-creator-in-strife,-claims-store-has-not-paid-him.html

https://www.linuxquestions.org/questions/slackware-14/donating-to-slackware-4175634729/

https://news.ycombinator.com/item?id=17605284

https://news.ycombinator.com/item?id=17598685

https://lwn.net/Articles/761004/

http://slackware.mirrors.tds.net/slackware/slackware-current/ChangeLog.txt

Fri Jul 27 21:01:22 UTC 2018

Hey folks, my first order of business here needs to be a huge thank you to everyone who has donated at https://paypal.me/volkerdi to help keep this project going. As most of you are already aware by now, the financial situation here at Slackware HQ has not been great for many years, including not getting any pay for the last two years and forcing me (and my family) to live very frugally while I continued to work on the project hoping I'd figure out a way to actually monetize it by the time that Slackware 15.0 is ready for release. I'm not trying to cast any blame regarding the situation. Really, I can only blame myself for not trying to build my own ship years ago when things began to not really work out. I'm still looking into sustainable funding options such as Patreon or Liberapay (or perhaps both), and I'm open to other ideas. I'm no longer in immediate danger of going broke, and I'm no longer entertaining the notion of joining my friends at the local potato chip factory in order to pay my bills. :) My family is grateful and humbled by the support we've received. Hope we'll be able to keep this project going for a long time. Also, I realize that the website lacks updates and needs attention and I will need to find some time to devote to that. I've never been much of a website designer, and the slackware.com site is basically left over from work done by former Walnut Creek / BSDi employees. I've never seen able to make much sense of the SQL backend. The interface to edit and post articles is clunky (and I'm not sure the PHP for that even works any more). When I've posted articles in recent years, I've done so by editing the main page already processed from PHP into HTML, which is pretty darn messy as I'm sure you can imagine. I tend to prioritize the distribution itself over other demands on my time - that's clearly a lot to do with how things ended up the way they did. So, I guess that's the report for now. Lots more work to do and not enough time to do it in… that part I don't see changing moving forward. :)

Thanks very much again. I'll do my best to keep you all posted.

- Pat

Added the article from LWN about this. As I get the links I'll keep updating.

Added Patrick Volkerding's message in the Current Changelog. I corrected some typing errors while I reformatted the text.

Added Slackware's Patreon link.

R:0 / I:0 / P:2 [R] [G] [-]

VirtualBox

If you ever want to use another Operating System without having to reboot into it, for example, you should try using a virtual machine.

In this thread, I'll be talking about VirtualBox. I installed four packages in total. Three from SlackOnly (pre-compiled) and one from SlackBuilds (I built it myself).

https://packages.slackonly.com/pub/packages/14.2-x86_64/system/virtualbox/

https://packages.slackonly.com/pub/packages/14.2-x86_64/system/virtualbox-addons/

https://packages.slackonly.com/pub/packages/14.2-x86_64/system/virtualbox-extension-pack/

https://slackbuilds.org/repository/14.2/system/virtualbox-kernel/

Those four worked fine here on a full Slackware64 14.2 installation.

I'm not going to get into the details of how to use VirtualBox. The VirtualBox Manual (https://www.virtualbox.org/manual/) should be a good reference if you're beginning to use VirtualBox.

R:0 / I:0 / P:2 [R] [G] [-]

youtube-dl + Twitch

Trying to send the output of youtube-dl + Twitch through mpv didn't work me. The cache keeps zeroing out, no matter the youtube-dl or mpv options that I used. In order to fix this, the best alternative that I found was to snatch the .m3u8 and use mpv from there. Below are the commands.

This works horribly (do not use it):

$ youtube-dl -f 720p -o - 'https://www.twitch.tv/monstercat' | mpv -

Now let's do it the right way. First let's check the quality options for any given stream:

$ youtube-dl -F 'https://www.twitch.tv/monstercat'

Then I chose 720p quality but added a "-g":

$ youtube-dl -f 720p -g 'https://www.twitch.tv/monstercat'

Then copy/paste the output using mpv:

$ mpv https://video-weaver.slc01.hls.ttvnw.net/v1/playlist/CokDQvdLXkvrpe8AaYXXNdyXRrHvlRjY0hxeG3DOwRZeNiffMPKrDrMY-Uj3-TolDdE7SBsEzi2DJS-Iu_PgAc65aQ3ABGAXFW4THfYWlPJBExo5Wq1vIeU8KSGBdrBU6cPP2GGO7f7QiPvUmeKJAL0iJnDnpOCcr1O5G4O0ue30evMBTjwOMtmNZJJP92v5PmHL2WHgT4qqoUlvB4roafDgPePTrVj2dXxZLMHpSp0jGSbLa2p6lp7SlvwmqHzVDq8lBkeTius5KiXAxcafp1PzvN0bM-AVr7nLmExJY2s_vqQYyM8tt6RQRkuUGmVK_esy1Ne2pDho-ZVTeH933yhwyWywH2JjIQeuPCHt07Pu6cMhBolKEt-A18bii2Rhv18wJTsDzahWwDu-PET3N0cZ_EO6mi3lscIXXeivUrquADoaI5Hk5Z1Otxjcl9CWMn9MyIeBBIIkBmaoAtgbqQXhmQkCqfowONdceM1zXU4XWSmHNM4o-TWG2NfVb8r9x61OB-0755jgDxYpEhAZjIfaVoo8Be8_dT6le5UqGgy9oP_E7Ii8XDU8WNY.m3u8

This way you can stream from Twitch without cache issues.

If you have a better solution to this, let us know!

R:0 / I:0 / P:2 [R] [G] [-]

youtube-dl + mpv

As promised, here is how you can watch videos from YouTube or Twitch, by combining youtube-dl + mpv.

You should read the previous post on how to use youtube-dl.

YouTube:

$ youtube-dl -f 22 -o - 'https://www.youtube.com/watch?v=fauJ0JQJNM0' | mpv - (if you want to choose the quality)

$ youtube-dl -o - 'https://www.youtube.com/watch?v=fauJ0JQJNM0' | mpv - (if you want to use the best quality detected by youtube-dl)

Those commands will pass the output through mpv instead of saving the file.

More information here: https://www.reddit.com/r/linux/comments/3un9pj/streaming_twitch_through_youtubedl/

Easy, fast and no browser exploits to deal with.

R:0 / I:0 / P:2 [R] [G] [-]

youtube-dl

This thread is about youtube-dl. What is youtube-dl?

youtube-dl is a command-line program to download videos from YouTube.com and a few more sites.

I used SlackOnly's youtube-dl package on a full Slackware 14.2 installation. No extra dependencies required.

https://packages.slackonly.com/pub/packages/14.2-x86_64/network/youtube-dl/

It isn't a new version, but so far it has worked flawlessly on YouTube and Twitch.

The instructions for a straight installation are here: http://rg3.github.io/youtube-dl/download.html

But the way I did it (updated) is like this:

1. $ curl -L 'https://yt-dl.org/downloads/latest/youtube-dl'

2. $ sudo mv youtube-dl /usr/local/bin/

3. $ sudo chown root:root /usr/local/bin/youtube-dl

4. $ sudo chmod 755 /usr/local/bin/youtube-dl

5. $ hash -r (this is necessary so that youtube-dl is located if you removed the youtube-dl slackonly package)

Examples for YouTube (How I do it):

$ youtube-dl -F 'https://www.youtube.com/watch?v=fauJ0JQJNM0'

Choose the format that you want. The one on the bottom (22) is also the "(best)".

$ youtube-dl -f 22 'https://www.youtube.com/watch?v=fauJ0JQJNM0'

The video will be downloaded to your current directory.

For more options: $ youtube-dl –help

In the next thread I'll explain how to combine youtube-dl with mpv, so you can watch videos from YouTube or Twitch without a browser. Much faster and less resource hungry!

Until then.

R:2 / I:0 / P:3 [R] [G] [-]

chcase

One of the scripts I've used a lot in the past is chcase. I still use it to this day, but with less frequency.

It is a perl script for renaming files. Slackware comes with "rename" if you want something else.

http://www.primaledge.ca/chcase.html

eval 'exec perl $0 ${1+"$@"}'
if 0;
# don't modify below here
#-------------------------
$VERSION='2.0';
# chcase 2.0
# Changes case of filenames
# http://www.primaledge.ca/chcase.html
# supermike, at primaledge daut ca
#

use Getopt::Std;
use Cwd;
use File::Basename;

sub HELP_MESSAGE {
print<<EOT;

chcase $VERSION
USAGE:
chcase [-terdlouCcqn] [-x '<perl exp>'] FILE...

-t : Test mode (don't actually rename any files)
-e : Print examples
-r : Rename recursively
-d : Also rename directories
-l : Rename & follow symbolic links (default is not to)
-o : Overwrite if file exists
-u : Change to uppercase (default is lower)
-C : Capitalize each word
-c : Capitalize first character only
-q : Quiet mode (no output)
-n : No escape characters (for bold/inverse output)
-x '<perl exp>' : Perl expression to operate on filename
like s/// or tr/// (you need the quotes)
case of filename not changed when this option used

EOT
exit;
}

sub EXAMPLES() {
print<<EOT;

chcase $VERSION
EXAMPLES:
\$ chcase My.DOC *.JPG /tmp/FileName.txt
=> files are changed to lowercase

\$ chcase -rdt .
=> show what would happen if we renamed all files and sub dirs
recursively in pwd to lowercase; remove t to do it for real

\$ chcase -rdoc /some/dir ./images/ *png
=> files and dirs recursively capitalized,
overwrite any existing already capitalized file

\$ chcase -x 's/projectx/PlanB/; s/ /_/g' *.doc
=> renames *.doc files substituting "projectx" with "PlanB",
and replacing all spaces with underscores

\$ find ./music/ -name "*mp3" | xargs chcase -x 'tr/a-zA-Z0-9.-_/_/cs'
=> find mp3 files under music/ dir, transliterate (and squash)
non-alphanumeric characters except for . or - to _

EOT
exit;
}

sub msg {
return if $opt_q; my($ol,$new,$err)=@_;
$out=' 'x($lvl-1).$s.$ol; $out.=" => $new" if $new;
$out.=" : $i$err" if $err; print "$out$n\n";
}

sub chcase {
$_=$old=shift;
$dn=dirname($_).'/'; $dn="" if ($dn eq './');
$_=basename($_);
if ($opt_x) { eval $opt_x; } else { $_=$opt_u ? uc : lc; }
$_=$dn.$_;
return($old) if (($old eq $_) or -d or (-f and !$opt_o));
if ($opt_t or rename($old, $_)) { msg($old,$_); return($opt_t ? $old : $_); }
else { msg($old,$_,$!); return($old); }
}

sub proc {
shift;
if (-l and !$opt_l) { return; }
if (-f) { chcase($_); }
elsif (-d) {
s/\/+$//;
if ($opt_d) { $_=chcase($_); }
if ($opt_r) {
my $cwd=cwd();
if (chdir($_)) { msg("$b$_/"); } else { msg("$b$_/",0,$!); return; }
$lvl++; $s='|__';
opendir(D,'.');
foreach (readdir(D)) { proc($_) unless (($_ eq '.') or ($_ eq '..')); }
closedir(D);
chdir($cwd);
$s='' if (--$lvl == 0);
}
}
}

sub init() {
$Getopt::Std::STANDARD_HELP_VERSION=true;
getopts( 'erdouqtnlCcx:' ) or HELP_MESSAGE();
EXAMPLES() if $opt_e;
unless ($opt_n) {$b="\033[01m"; $i="\033[03m"; $n="\033[0m"; }
$opt_x='s/([^_-\s]+)/\u\L$1/g' if $opt_C;
$opt_x='$_=ucfirst(lc)' if $opt_c;
}

init();
while ($_=shift @ARGV) { proc($_); }

R:0 / I:0 / P:3 [R] [G] [-]

mpv: Video player based on MPlayer/mplayer2

Currently my favourite video player is mpv.

Overview: mpv is a media player based on MPlayer and mplayer2. It supports a wide variety of video file formats, audio and video codecs, and subtitle types.

Links:

https://mpv.io/

https://github.com/mpv-player/mpv

I prefer to compile mpv myself instead of using a SlackBuild or downloading a pre-compiled package.

Installation instructions (read Generic Instructions): https://github.com/mpv-player/mpv-build

It's important to notice that you don't need to run ./install (read Generic Instructions). Just copy the binary to /user/local/bin or any other place of your choice (preferably inside a executable path).

mpv creates the directory $HOME/.config/mpv

The watch_later directory according to the documentation "Contains temporary config files needed for resuming playback of files with the watch later feature." Use Shift+q/Q to quit a video with resume playback. Play the file normally again and you'll notice it'll resume from when you quit. Quite handy.

You can edit the files in $HOME/.config/mpv to your taste, but here goes my mpv.conf (I have no GUI for mpv):

$ cat .config/mpv/mpv.conf

# Write your default config options here!

#

# Profile:

#profile=pseudo-gui

#

# Gui:

#player-operation-mode=pseudo-gui

#

#terminal=yes

#input-terminal=yes

# Video:

vo=gpu

brightness=0

contrast=0

hue=0

saturation=0

monitoraspect='16:9'

keepaspect

#

# Audio:

ao=pulse

volume=50

volume-max=200

#volstep=5

#softvol=no

#

# Playback:

#mc=0.2

#autosync=30

#

# Subtitles:

sub-ass=yes

sub-font-size=35

#ass-force-style='FontName=Clean,Style.Regular=1'

#vf=sub=125:0

#sub-pos=90

#

# OSD:

#really-quiet

osd-font-size=20

#osd-blur=20

#osd-color=0.5/0.75

osd-msg1=''

osd-msg2='${time-pos} / ${duration}'

osd-msg3='${time-pos} / ${duration} (${percent-pos}%)${?cache: ${cache}%} x${speed} ${frame-drop-count} ${avsync}\n${filename}'

My input.conf is almost the default so I won't paste it here.

From the mpv IRC channel a long time ago I got the following command line to compile mpv after a first compilation: ./update –master && ./clean && ./build -j4

I put that inside a text file, made it executable (you can also use sh to execute it) and then I run it in the mpv-build directory whenever I want to update mpv. Before using it yourself, check the documentation. That command line is old and I haven't verified if it's still recommended (I do need to read the documentation too).

$ cat programs/mpv-build/j2run

./update –master && ./clean && ./build -j4

Have fun!

R:0 / I:0 / P:3 [R] [G] [-]

uMatrix

I use the Pale Moon Browser, and some time after updating to version 27.9.1 I got a warning about NoScript. I should have taken a screenshot, but now NoScript has been uninstalled. You can read more information here: https://forum.palemoon.org/viewtopic.php?f=46&t=17619&sid=c7f6d33ac4abb02a3344d2b17b5bfbb5

So keeping just uBlock Origin + hosts file (https://pgl.yoyo.org/adservers/) internet filtering wasn't enough for me. Javascript is a real pain, not as much as Adobe Flash (I know they're different), but I dislike both because of security issues.

I decided to look around and I found uMatrix (http://addons.palemoon.org/incompatible/ recommends version 1.1.4) from the same developer of uBlock Origin, and it is awesome.

Check this tutorial: https://www.electricmonk.nl/docs/umatrix_tutorial/umatrix_tutorial.html

uMatrix Wiki: https://github.com/gorhill/uMatrix/wiki

Various Links:

https://github.com/gorhill/uMatrix

https://addons.mozilla.org/en-US/firefox/addon/umatrix/

https://www.ghacks.net/2017/11/28/a-umatrix-guide-for-firefox/

It might take some time to get used to it, but it's worth learning.

The gHacks guide above recommends disabling/removing any other content blocker (NoScript, uBlock Origin, Adblock Plus etc) to avoid issues with uMatrix.

I reinstalled uBlock Origin, because uMatrix does not have element picking. Luckily all my settings were restored.

R:0 / I:0 / P:3 [R] [G] [-]

Updating Slackware Packages on Stable

There are two commands that I use to update Slackware 14.2 packages on Stable.

First: $ sudo slackpkg update

Second: $ sudo slackpkg upgrade-all

The "update" will download the latest package lists from a Slackware mirror selected in /etc/slackpkg/mirrors.

The "upgrade-all" will prompt which packages will be updated, and the user can select/deselect at will.

This method will not install non existent packages, neither will it upgrade your installation to Current. Check slackpkg's man page for more information.

A few important things to notice:

1. To use sudo, you need to add your username to /etc/sudoers like this (you have to edit as root):

##

## User privilege specification

##

root ALL=(ALL) ALL

username ALL=(ALL) ALL

There is a thread about visudo, which is the proper way to edit /etc/sudoers in Slackware. Check it!

If you don't know your username, try: $ id

2. Read the files in /etc/slackpkg. They contain important information on how to configure slackpkg, selecting a mirror (you need only one) and blacklisting packages.

R:0 / I:0 / P:3 [R] [G] [-]

Kernel initrd upgrade procedure

I'll explain here how I upgrade my kernel, using the official upgrade packages for Slackware 14.2. I used to upgrade my monolithic kernel using the ones provided by kernel.org, but some things always broke in one way or another, so I've been using only the official Slackware kernel upgrades now.

Before I begin, a few important things to consider:

I'll be focusing on an initrd kernel here. If you want a monolithic one, don't make an initrd, create the symbolic links to the proper *huge* kernel in /boot, edit /etc/lilo.conf properly and don't forget to run lilo.

Do not upgrade your kernel if you're unable to reboot as soon as possible, unless you're running a monolithic (non initrd) kernel. The reason for this is that once you upgrade, the old kernel modules are gone and a initrd kernel (loaded in memory) might request them and they won't be found, because you upgraded to a newer version. That breaks things, so unless you're using a monolithic kernel, reboot the new kernel once the upgrade procedures are done.

It's recommended that you use an initrd instead of a monolithic kernel. You can read more here: https://www.distributednetworks.com/configure-key-linux-components/module2/modular-monolithic-kernels.php

Make sure you haven't blacklisted the kernel packages in /etc/slackpkg/blacklist. If you have, slackpkg will not upgrade the kernel packages at all.

# /usr/share/mkinitrd/mkinitrd_command_generator.sh –longhelp, because it has useful information.

Also read /usr/doc/mkinitrd-1.4.10/README.initrd

I'll be using lilo, not grub.

Let's begin:

1. Generating a initrd for your system:

In a (virtual) terminal, go to /usr/share/mkinitrd and as root: # mkinitrd_command_generator.sh

That command will show you a proper mkinitrd for your system, like mine: mkinitrd -c -k 4.4.118 -f ext4 -r /dev/sdb2 -m xhci-pci:ohci-pci:ehci-pci:xhci-hcd:uhci-hcd:ehci-hcd:hid:usbhid:i2c-hid:hid_generic:hid-cherry:hid-logitech:hid-logitech-dj:hid-logitech-hidpp:hid-lenovo:hid-microsoft:hid_multitouch:jbd2:mbcache:ext4 -u -o /boot/initrd.gz

In order to use it, just run as root: # mkinitrd -c -k 4.4.118 -f ext4 -r /dev/sdb2 -m xhci-pci:ohci-pci:ehci-pci:xhci-hcd:uhci-hcd:ehci-hcd:hid:usbhid:i2c-hid:hid_generic:hid-cherry:hid-logitech:hid-logitech-dj:hid-logitech-hidpp:hid-lenovo:hid-microsoft:hid_multitouch:jbd2:mbcache:ext4 -u -o /boot/initrd.gz

You don't have to copy/paste the entire thing though. Check "# mkinitrd_command_generator.sh –longhelp" that teaches how to execute the output.

By doing so, you'll have a fresh /boot/initrd.gz

2. Updating the symbolic links:

Go to /boot and delete the old symbolic links, and then generate the proper new ones.

# rm System.map config vmlinuz

# ln -s System.map-generic-4.4.118 System.map

# ln -s config-generic-4.4.118 config

# ln -s vmlinuz-generic-4.4.118 vmlinuz

3. Edit /etc/lilo.conf properly:

Go to /etc and edit lilo.conf so it points to the correct initrd and kernel. Mine looks like this:

# Linux bootable partition config begins

image = /boot/vmlinuz

initrd = /boot/initrd.gz

root = /dev/sdb2

label = Linux

read-only

# Linux bootable partition config ends

So you can see /boot/vmlinuz and /boot/initrd are both there.

Feel free to just add the above as an extra boot section so if something goes wrong, just reboot and select another one that works. If you forget to run lilo after all this you'll be unable to boot the initrd you just created.

Save /etc/lilo.conf and as root: # lilo -v

4. Reboot your system:

# shutdown -r now

R:3 / I:0 / P:3 [R] [G] [-]

Massive ChangeLog.txt update

There has been a massive ChangeLog.txt update for Slackware Current.

Patrick explains the changes there.

Have fun!

http://slackware.mirrors.tds.net/slackware/slackware-current/ChangeLog.txt

R:0 / I:0 / P:3 [R] [G] [-]

VPN Killswitch using IPTables

As promised, here is the IPTables script that I use. Please note that this is only for IPv4.

It's designed to block internet connections while the VPN is disabled.

I've made some modifications of my own.

In /etc/rc.d/rc.inet2 there is a section left for rc.firewall where you can enable it.

I hid the –dport on purpose.

There is also /usr/doc/openvpn-2.4.6/sample-config-files/firewall.sh, for those that have upgraded to OpenVPN 2.4.6 and want a sample IPTables that's specific for OpenVPN.

Source: https://linuxconfig.org/how-to-create-a-vpn-killswitch-using-iptables-on-linux

$ cat /etc/rc.d/rc.firewall

#!/bin/sh

# Base Rules
# Before you configure iptables to allow any traffic you need to switch its default to disallow all traffic. Add these three rules to drop all traffic (IPv4 and IPv6) by default.
/usr/sbin/iptables -P INPUT DROP
/usr/sbin/iptables -P FORWARD DROP
/usr/sbin/iptables -P OUTPUT DROP

# Input
# It's most secure to only allow inbound traffic from established or related connections. Set that up next.
/usr/sbin/iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT

# Loopback and Ping
# Next, allow the loopback interface and ping.
# This assumes that your VPN connection is on tun0. Check that with ip a, if you're not sure.
/usr/sbin/iptables -A OUTPUT -o lo -j ACCEPT
/usr/sbin/iptables -A OUTPUT -o -tun0 -p icmp -j ACCEPT

# LAN
# It doesn't make much sense to shut down or block your LAN traffic, especially on a home network, so allow that too.
/usr/sbin/iptables -A OUTPUT -d 192.168.0.0/24 -j ACCEPT
/usr/sbin/iptables -A OUTPUT -d 192.168.100.0/24 -j ACCEPT

# Modem
# When the VPN is on, the following route is required so the modem can be reachable.
/usr/sbin/ip route add 192.168.100.0/24 via 192.168.0.1

# Tor
# This is needed so Tor can connect to the internet.
/usr/sbin/iptables -A INPUT -i lo -j ACCEPT

# DNS
# For this next part, you're going to need to know the IP address of your VPN's DNS server(s). If your VPN has access or you use resolv.conf, you'll probably find them in there.
/usr/sbin/iptables -A OUTPUT -d 8.8.8.8 -j ACCEPT
/usr/sbin/iptables -A OUTPUT -d 8.8.4.4 -j ACCEPT

# Allow The VPN
# Of course, you need to allow the VPN itself. There are two parts to this. You need to allow both the service port and the interface.
# Again, check the port and interface that your VPN connection is using.
/usr/sbin/iptables -A OUTPUT -p udp -m udp --dport **** -j ACCEPT
/usr/sbin/iptables -A OUTPUT -o tun0 -j ACCEPT

If you want to list the rules (I find it easier to do both):

# iptables -L -n -v && iptables -S

If you want to flush and accept everything (same as disabling the firewall):

# iptables -F && iptables -P INPUT ACCEPT && iptables -P FORWARD ACCEPT && iptables -P OUTPUT ACCEPT

Notice that if you run the script above, flush everything and then run the script again, you'll get a warning message about NETLINK. That's because the line "/usr/sbin/ip route add 192.168.100.0/24 via 192.168.0.1" is running again on the already valid route. To avoid this message, you can comment out the infringing line (add a # to the beginning) so when you run the script the route line will be ignored (it's already active), or you could flush the route (instructions at https://ss64.com/bash/ip-route.html), which I consider unnecessary.

R:0 / I:0 / P:3 [R] [G] [-]

OpenVPN-2.4.6 issues

Slackware Current and Stable OpenVPN packages have been upgraded to version 2.4.6.

This has brought issues not because of OpenVPN itself, but /etc/rc.d/rc.openvpn has changed and I had to adapt.

After the upgrade, I noticed that the OpenVPN process was closing somehow, and I would be "disconnected" from the internet. "Disconnected" because I have IPTables rules in place that only allow access to the internet through the VPN.

I triple checked the VPN .conf files and nothing worked. Next thing was to check if anything appeared in /var/log/, and indeed /var/log/syslog gave some clues:

Apr 28 00:01:29 compass openvpn[17181]: Error opening 'Auth' auth file: /etc/openvpn/credentials.txt: Permission denied (errno=13)

Apr 28 00:01:29 compass openvpn[17181]: ERROR: Linux route delete command failed: external program exited with error status: 2

Apr 28 00:01:29 compass last message repeated 3 times

Apr 28 00:01:29 compass openvpn[17181]: Linux ip addr del failed: external program exited with error status: 2

Apr 28 07:24:14 compass openvpn[15891]: WARNING: file '/etc/openvpn/credentials.txt' is group or others accessible

Apr 28 07:24:14 compass openvpn[15892]: WARNING: you are using user/group/chroot/setcon without persist-tun – this may cause restarts to fail

Apr 28 07:24:14 compass openvpn[15892]: WARNING: you are using user/group/chroot/setcon without persist-key – this may cause restarts to fail

Apr 28 07:24:15 compass openvpn[15892]: WARNING: 'link-mtu' is used inconsistently, local='link-mtu 1550', remote='link-mtu 1570'

Apr 28 07:24:15 compass openvpn[15892]: WARNING: 'cipher' is used inconsistently, local='cipher AES-256-GCM', remote='cipher AES-128-CBC'

Apr 28 07:24:15 compass openvpn[15892]: WARNING: 'auth' is used inconsistently, local='auth [null-digest]', remote='auth SHA256'

Apr 28 07:24:15 compass openvpn[15892]: WARNING: 'keysize' is used inconsistently, local='keysize 256', remote='keysize 128'

Apr 28 07:32:50 compass openvpn[15892]: event_wait : Interrupted system call (code=4)

Apr 28 07:32:50 compass openvpn[15892]: ERROR: Linux route delete command failed: external program exited with error status: 2

Apr 28 07:32:50 compass last message repeated 3 times

Apr 28 07:32:50 compass openvpn[15892]: Linux ip addr del failed: external program exited with error status: 2

Apr 28 07:34:13 compass openvpn[16641]: WARNING: file '/etc/openvpn/credentials.txt' is group or others accessible

Apr 28 07:34:14 compass openvpn[16642]: WARNING: 'link-mtu' is used inconsistently, local='link-mtu 1550', remote='link-mtu 1570'

Apr 28 07:34:14 compass openvpn[16642]: WARNING: 'cipher' is used inconsistently, local='cipher AES-256-GCM', remote='cipher AES-128-CBC'

Apr 28 07:34:14 compass openvpn[16642]: WARNING: 'auth' is used inconsistently, local='auth [null-digest]', remote='auth SHA256'

Apr 28 07:34:14 compass openvpn[16642]: WARNING: 'keysize' is used inconsistently, local='keysize 256', remote='keysize 128'

So basically I had to do two things:

1. Make /etc/openvpn/credentials.txt root:nobody instead of root:root, because /etc/rc.d/rc.openvpn (check it out) now runs as user:group nobody:nobody.

2. Add persist-tun and persist-key to my OpenVPN config files.

You'll notice above that credentials.txt has the "Permission denied" message, and then "group or others accessible". That's because I changed the user:group and syslog caught up on that.

It's a good a idea to keep the old rc.openvpn around if you upgrade OpenVPN, so you can check what changed between versions.

With OpenVPN 2.4.* you can now use cipher negotiation (GCM was added), so you have more options to choose from if your VPN provider supports them.

The warnings link-mtu, cipher and so on are nothing to worry about from what I researched.

The "Linux route" and "ip addr" messages are because OpenVPN is trying to create a route that already exists (from what I've read), so they would probably go away if I restarted my network.

I'll make a separate thread soon with my /etc/rc.d/rc.firewall configuration.

If you're in a hurry or want something else, check /usr/doc/openvpn-2.4.6/sample-config-files/ where you can find plenty of examples.

R:0 / I:0 / P:3 [R] [G] [-]

PulseAudio

So Patrick has decided to create extra/pure-alsa-system for those who have issues with PulseAudio, and prefer alsa instead.

Check the Slackware Current ChangeLog.txt below for more, but the screenshot is complete.

http://slackware.mirrors.tds.net/slackware/slackware-current/ChangeLog.txt

R:0 / I:0 / P:3 [R] [G] [-]

How to copy paste between xterm

Here is how to copy/paste text to and from xterm.

First you need to enable "Select to Clipboard" in the VT Options menu. You can do so by holding Ctrl + Middle Mouse/Scroll button inside xterm. If you don't have the Middle Mouse/Scroll button but have it emulated by pressing both the Left + Right mouse buttons simultaneously, it should also work.

Once that is done, you can paste text you just copied (from Firefox for example) to xterm using Shift + Insert.

To paste text from xterm to Firefox, all you need to do is to select the text in xterm (use the Left Mouse button) and then paste (Ctrl + v) as you normally would in Firefox.

You can also use the Middle Mouse/Scroll button to paste text that you copied from xterm to itself. So you could copy text in xterm (select the text using the Left Mouse button) then paste using the Middle Mouse/Scroll button, or use Shift + Insert.

Don't forget to check the other xterm options, by holding Ctrl then using either the Left/Right/Middle Mouse buttons. There are quite a lot of options to the different menus.

R:0 / I:0 / P:3 [R] [G] [-]

PS1

My PS1.

To set it, do in a console/terminal:

1. Make a backup of your current PS1: echo $PS1

Save the text somewhere, or just open a new terminal emulator and do it there. It won't be saved.

2. export PS1='\[\e[m\n\e[1;30m\][$$:$PPID \j:\!\[\e[1;30m\]]\[\e[0;36m\] \[\e[1;30m\][\e[0;36m\]\@ \d\[\e[1;30m] \[\e[1;30m\][\[\e[1;34m\]\u@\H\[\e[1;30m\]:\[\e[0;37m\]${SSH_TTY} \[\e[0;32m\]+${SHLVL}\[\e[1;30m\]] \[\e[1;37m\]\w\[\e[0;37m\] \n($SHLVL:\!)\$ '

Feel free to also share yours!