Click here to Skip to main content
15,894,017 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
General.bash_history makes me happy, how about you? Pin
raddevus9-Mar-24 13:34
mvaraddevus9-Mar-24 13:34 
I had used Windows since 3.0 (ca 1991) before I switched to main usage of Linux in 2019 so please don't make fun of me for this too much.

I've been working on setting up my .NET Core WebAPIs (hosted under various domains but running on one copy of a DigitalOcean droplet (running Debian)) and setting up the services and forwarding via Nginx and all that. It's all command-line there are a lot of steps that I forget often.

1. set up a service file in /etc/systemd/system/
2. build the WebAPI and deploy it under a folder in /var/www/
3. configure nginx to point at your webAPI
4. create link to the nginx config ln -s /etc/nginx/sites-available/<apiName> /etc/nginx/sites-enabled/

There's a bunch of things and I would lose the commands and forget things I should do.
And, I be forever up-arrowing to get to old commands that I had used.

.bash_history
Then I stumbled upon the .bash_history file and noticed I can open it up in an editor (nano, of course, because I am vim-weak and don't know how to exit vim Laugh | :laugh: )

Wow, that is really cool that all those commands are just sitting in there like that so I can now pull them out and save them to a file with some documentation.

Thank you, Linux, it seems like you get better all the time. Laugh | :laugh:

I bet you already knew about .bash_history didn't you? Well, try not to laugh at me too hard for only finding it now. Smile | :)
GeneralRe: .bash_history makes me happy, how about you? Pin
k50549-Mar-24 15:59
mvek50549-Mar-24 15:59 
GeneralRe: .bash_history makes me happy, how about you? Pin
raddevus9-Mar-24 16:02
mvaraddevus9-Mar-24 16:02 
GeneralRe: .bash_history makes me happy, how about you? Pin
Peter_in_27809-Mar-24 21:06
professionalPeter_in_27809-Mar-24 21:06 
GeneralRe: .bash_history makes me happy, how about you? Pin
Nelek9-Mar-24 22:25
protectorNelek9-Mar-24 22:25 
GeneralRe: .bash_history makes me happy, how about you? Pin
11917640 Member 11-Mar-24 21:41
11917640 Member 11-Mar-24 21:41 
GeneralStandards? Eat your heart out, Randall Pin
Peter_in_278025-Feb-24 15:07
professionalPeter_in_278025-Feb-24 15:07 
GeneralRe: Standards? Eat your heart out, Randall Pin
trønderen25-Feb-24 17:10
trønderen25-Feb-24 17:10 
GeneralRe: Standards? Eat your heart out, Randall Pin
jeron126-Feb-24 5:37
jeron126-Feb-24 5:37 
GeneralRe: Standards? Eat your heart out, Randall Pin
Nelek26-Feb-24 5:38
protectorNelek26-Feb-24 5:38 
GeneralRe: Standards? Eat your heart out, Randall Pin
Peter_in_278026-Feb-24 10:31
professionalPeter_in_278026-Feb-24 10:31 
GeneralRe: Standards? Eat your heart out, Randall Pin
Amarnath S30-Mar-24 0:03
professionalAmarnath S30-Mar-24 0:03 
GeneralRe: Standards? Eat your heart out, Randall Pin
trønderen31-Mar-24 11:11
trønderen31-Mar-24 11:11 
GeneralSupporting multiple cores from bare metal C Pin
honey the codewitch13-Feb-24 6:17
mvahoney the codewitch13-Feb-24 6:17 
GeneralRe: Supporting multiple cores from bare metal C Pin
11917640 Member 14-Feb-24 22:39
11917640 Member 14-Feb-24 22:39 
GeneralRe: Supporting multiple cores from bare metal C Pin
honey the codewitch15-Feb-24 0:03
mvahoney the codewitch15-Feb-24 0:03 
GeneralRe: Supporting multiple cores from bare metal C Pin
11917640 Member 15-Feb-24 1:04
11917640 Member 15-Feb-24 1:04 
GeneralRe: Supporting multiple cores from bare metal C Pin
honey the codewitch15-Feb-24 5:03
mvahoney the codewitch15-Feb-24 5:03 
GeneralSource Generators in C# and TDD misadventure time Pin
honey the codewitch31-Jan-24 6:30
mvahoney the codewitch31-Jan-24 6:30 
GeneralRe: Source Generators in C# and TDD misadventure time Pin
Graeme_Grant31-Jan-24 21:18
mvaGraeme_Grant31-Jan-24 21:18 
GeneralRe: Source Generators in C# and TDD misadventure time Pin
honey the codewitch1-Feb-24 5:58
mvahoney the codewitch1-Feb-24 5:58 
GeneralRe: Source Generators in C# and TDD misadventure time Pin
Graeme_Grant1-Feb-24 8:31
mvaGraeme_Grant1-Feb-24 8:31 
GeneralCommand line fun in .NET Pin
honey the codewitch27-Jan-24 7:10
mvahoney the codewitch27-Jan-24 7:10 
GeneralRe: Command line fun in .NET Pin
PIEBALDconsult27-Jan-24 7:24
mvePIEBALDconsult27-Jan-24 7:24 
GeneralRe: Command line fun in .NET Pin
honey the codewitch27-Jan-24 7:37
mvahoney the codewitch27-Jan-24 7:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.