# GNULinux

## January 24, 2022

Use pastebin from command line

Use pastebin from command line

Quite often, when you have a problem where, in order to get help you need to paste the contents of a file,or command output so that it can be shared, for example on IRC (Chat) or a forum, this can be challenging to begin with.

As it is depreciated that you paste more than 2 lines in to IRC chat. The way round this is to use a service called pastebin. Debian [1] has it's own service for this [2]. There is a tool called pastebinit which is really helpful from the command line.

The first step is to switch to the root user. Sear for and install the package pastebinit as per below.

Search

root@Desktop:/home/user# apt search pastebinit
Sorting... Done
Full Text Search... Done
pastebinit/stable 1.5.1-1 all
command-line pastebin client


Install

root@Desktop:/home/user# apt install pastebinit
Building dependency tree... Done
The following packages were automatically installed and are no longer required:
linux-image-5.10.0-7-amd64 linux-image-5.10.0-8-amd64
Use 'apt autoremove' to remove them.
The following NEW packages will be installed:
pastebinit
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 46.6 kB of archives.
After this operation, 342 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bullseye/main amd64 pastebinit all 1.5.1-1 [46.6 kB]
Fetched 46.6 kB in 0s (342 kB/s)
Selecting previously unselected package pastebinit.
(Reading database ... 190310 files and directories currently installed.)
Preparing to unpack .../pastebinit_1.5.1-1_all.deb ...
Unpacking pastebinit (1.5.1-1) ...
Setting up pastebinit (1.5.1-1) ...
Processing triggers for man-db (2.9.4-2) ...
root@Desktop:/home/user#


Once complete switch back to normal user (usually type exit)

user@Desktop:~$cat /etc/apt/sources.list > pastebinit user@Desktop:~$ cat /etc/apt/sources.list | pastebinit
https://paste.debian.net/1228146/


In this example I have used the cat command and piped the contents in to pastebinit, this has given me a url to paste in to chat, (or copy manually)

Open this in a browser and you and others can see the contents, and people can help you further.

This is really useful too if you are stuck at the command prompt, without a graphical interface.

## November 6, 2021

Resize and rename multiple files

As I was renaming and resizing some files anyway. I decided to make this short video of the process. I have added to Debian category as I am using Debian 11.

Commands used:-

gm -mogrify -resize 640x480 *.JPG AND rename 's/P1/codeclub/'

As usual your mileage may vary, you need to check man pages for specific arguments for your needs.

Happy to try and help further via Mastodon

Fedi id : zleap@qoto.org

Tags