/r/commandline
This is for anything regarding the command line, in any operating system. All questions (including dumb ones), tips, and links to interesting programs/console applications you've found or made yourself are welcome. Linux / BSD / OSX / Windows CLI and TUI apps or questions or comments, we're happy to take them all!
-----------------------------
/ This is for anything
| regarding the command line, |
| in any operating system. All |
| questions (including dumb |
| ones), tips, and interesting |
| programs/console applications |
| you've found or made yourself |
| are welcome. Please read the |
| rules, and you're welcome to |
| flair your posts if you want |
\ to. / |
---|
\ ^__^
\ (OO)\_______
(__)\ )\/\
||----w |
|| ||
commandline@reddit ~ $ _
If you're asking for help, remember to help the community by stating what OS and version you're using, and if at all possible paste any commands you've tried and any errors or output that you've seen.
Related subreddits:
/r/commandline
Could anybody explain, in which directory (or directories) I should place my own shell scripts and configuation files on macOS?
/usr/local/bin/
?/usr/local/etc/
?$HOME/bin/
?$HOME/etc/
?A best practice or a most common way?
Example files are:
webpage2pdf.zsh
- an ImageMagick script to convert a webpage to PDF.webpage2pdf
- a configuration file for it.zshrc_my-own
- a Zsh cofiguration file that is sourced in my ~/.zshrc
using source
, as suggested by Gilles to avoid accidental overridings: https://unix.stackexchange.com/a/787409Hi everyone,
I'm trying to convert a technical drawing in PDF format into a DXF that can be laser cut.
I tried
Any help would be appreciated.
I tried warp, and the prompts seems pretty cool. How do you achieve that without using warp? I assume it wouldn't be that hard and someone would've done it
I need some help. What I want to know is if there is any terminal app, like caffeine extension of gnome, that I can install, that it's already on the ubuntu repository.
Hi, I've created an encrypted-journaling command-line application inspired by https://jrnl.sh It is just a single bash script for the app, and another script for the setup. I wanted something that was dead simple, and something that does not have too many dependencies.
The idea is to use existing tools to just start writing, and have the records automatically arranged in a specified folder.
Please check out the project here: https://github.com/nilz-bilz/cli-jrnl and let me know if there are any changes or improvements you guys would like to see. I haven't yet tested this on mac and other Unix systems, so it would be great to get some feedback on those platforms as well. Thanks
I want to take an image that is too wide to work as a wallpaper for my monitor (ie: a 32:9 wallpaper while I'm using my 21:9 monitor, or a 21:9 or 32:9 wallpaper while I'm using my laptop with no external monitor) and cut it into 10 equally spaced slices to show on my 10 workspaces, I'm hoping to get the same effect as on my android phone, where as I swipe to the right, it pans to the right on my background image.
A more concrete example, if I have a 5120x1440 image, and I'm using my 3440X1440 monitor, I want to create 10 horizontally cropped slices of the image. 1st going from 0-3440, 2nd going from 168-3608, 3rd going from 336-3773, etc incrementing by 168 each time (168 comes from (width of the original image - goal width)/number of workspaces, so (5120-3440)/10).
I can work out on my own how to script everthing else to work, what I need to figure out is how to make a script:
Is there a simpler tool to do that or should I just learn Imagemagick? I'm under the impression that imagemagick is in the same tier as ffmpeg as far as power and complexity, is this true or am I just avoiding it for nothing?
What would be the commands for that if I wanted to change lets say 40% of PC's local machine admin passwords? Only by using cmd. Or atleast to one person?
I learned today, that I could extract a reddit video using yt-dlp, which I normally use for Youtube content.
First, you need to review the codecs and figure out which video/audio streams you want to use.
$ yt-dlp -F https://www.reddit.com/r/commandline/comments/1gzg8wu/docfd_900rc1_tui_multiline_fuzzy_document_finder/
[Reddit] Extracting URL: https://www.reddit.com/r/commandline/comments/1gzg8wu/docfd_900rc1_tui_multiline_fuzzy_document_finder/
[Reddit] 1gzg8wu: Downloading JSON metadata
[Reddit] 1gzg8wu: Downloading m3u8 information
[Reddit] 1gzg8wu: Downloading MPD manifest
[info] Available formats for 3wfqau4r113e1:
ID EXT RESOLUTION FPS â FILESIZE TBR PROTO â VCODEC VBR ACODEC MORE INFO
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
dash-4 mp4 854x480 â ~ 1.72MiB 335k https â avc1.4d401f 335k video only DASH video, mp4_dash
hls-272 mp4 854x480 30 â ~ 1.39MiB 272k m3u8 â avc1.4D401F 272k video only
dash-5 mp4 1280x720 â ~ 2.90MiB 566k https â avc1.4d401f 566k video only DASH video, mp4_dash
fallback mp4 1280x720 â â 12.30MiB 2400k https â h264 2400k video only DASH video, mp4_dash
hls-429 mp4 1280x720 30 â ~ 2.20MiB 429k m3u8 â avc1.4D401F 429k video only
Then you extract the video. In this example, only the video codecs are available.
$ yt-dlp --format dash-4 https://www.reddit.com/r/commandline/comments/1gzg8wu/docfd_900rc1_tui_multiline_fuzzy_document_finder/
[Reddit] Extracting URL: https://www.reddit.com/r/commandline/comments/1gzg8wu/docfd_900rc1_tui_multiline_fuzzy_document_finder/
[Reddit] 1gzg8wu: Downloading JSON metadata
[Reddit] 1gzg8wu: Downloading m3u8 information
[Reddit] 1gzg8wu: Downloading MPD manifest
[info] 3wfqau4r113e1: Downloading 1 format(s): dash-4
[download] Destination: Docfd 9.0.0-rc1ï¼ TUI multiline fuzzy document finder [3wfqau4r113e1].mp4
[download] 100% of 1.21MiB in 00:00:00 at 8.46MiB/s
-rw-r--r-- 1 XXX XXX 1267032 Nov 25 04:56 Docfd 9.0.0-rc1ï¼ TUI multiline fuzzy document finder [3wfqau4r113e1].mp4
I know I can vimdiff two files, but in the case it's two texts I can grab them from the clipboard, can I avoid creating files?
Hey everyone!
I just finished building a simple but powerful email spammer called youGotMail in Rust. It allows you to send emails to a list of targets using your own Gmail accounts.
git clone https://github.com/NewDawn0/youGotMail
Please be aware that I, the author, am not responsible for any misuse of this tool. Use it at your own risk.**
Hello.
Internally, I use fetchmail to consolidate my various domains into one master local server. I keep the last ~7 days on the remote server, until they are purged, so that I can still view urgent messages using webmail.
This is a basic crontab to use with fetchmail, when using the 'keep' directive.
MAILTO=""
*/5 * * * * cd $HOME; flock "/var/lock/fetchmail.$(whoami).lock" fetchmail
01 0 * * 0 cd $HOME; flock "/var/lock/fetchmail.$(whoami).lock" fetchmail --flush
Hey hey,
I have some ubuntu machines and i use the google ecosystem since many years. Sometimes i think of things i want to remember, when i'm sitting at a terminal. What would be the easiest way to get a note on to the google ecosystem (or in worst case, some other cloud/server service) ?
I don't really need to read what is already there, but i would like to put something on to the stack, if you see what i mean. I can later review and edit/compile the notes, from a desktop machine.
NB: these are headless machines i am SSH:ing into.
r/bash deleted my post instantly, so here i post.
I run minecraft on my laptop while linking the datafile to an smb share.
So every time I want to play, i need to mount said share, and THEN open the mc app. I created a script that does that for me automatically, but i see it returning a strange message.
i'm pretty much a noob in writing code, but i try my best replicating what i watch on yt😅.
these are the two scripts i made
connectmc
#!/bin/bash
mkdir ~/Desktop/mclink ; mount_smbfs //user@server/Desktop ~/Desktop/mclink && echo Server Connected && open -a minecraft || echo Server Not Connected ; rmdir ~/Desktop/mclink
ejectmc
#!/bin/bash
killall launcher ; sleep 5
umount ~/Desktop/mclink && rmdir ~/Desktop/mclink && echo Server Disconnected
so, after all that introduction.
my connection script returns both a success message and an error to rmdir
can anyone tell my why im getting this?
$ connectmc
Server Connected
rmdir: /Users/user/Desktop/mclink: Resource busy
ejectmc works fine btw😁!
SOLVED. See below
I've installed zoxide as an apt package on a fresh ubuntu install, version 0.9.3, in Bash.
I have the required:
eval "$(zoxide init bash)"
In the .bashrc.
The question is the history is not building correctly on its own. An example:
I can add a directory manually with zoxide add, but it's very inconvenient, kind of messes up the main strength of the tool.
Any help will be much appreciated, thanks in advance
Solution
The issue was I was loading zoxide and then changing the PROMPT_COMMAND later in my .bashrc Moving it below solved it. Thanks to u/mattmc3
I am setting up this server as a code lab so my friends can use it. What can I run in the background as something cool to look at while I am at away?
I am currently using asciiquarium.