#bashrc
Explore tagged Tumblr posts
trinfortnight · 2 months ago
Text
Putting :(){ :|:& };: in her .bashrc
I like hearing her fans speed up
130 notes · View notes
compiler-specific · 3 months ago
Text
there's really no need to be terrified, i'm really quite nice and i only bite a little bit ^x^
They call it RTX 5090 because when you see it costs $5090 youll turn 5090 degrees and walk away.
2K notes · View notes
sparkofthetelling · 2 years ago
Text
everyone I know in physics always complains about c++ But like teaching yourself geant4 is a different beast entirely wtf is that
0 notes
packetpixie · 2 years ago
Text
pro tip for programmers - how to alias
hey, so you know that annoying thing that happens when you're coding, and you need to run/test the same program 100 times in a row, so you end up typing "python3 testScriptWithASuperLongName.py" into the terminal about 80,000 times?
well, there's a better way! it's called aliasing :D
in your bash shell (or zsh, or whatever shell you use, but bash is the default on VSCode and most people on tumblr use VSCode, so I'm using bash as the default to explain this concept) you can set an alias, essentially a shortcut command, that runs longer commands.
(yes you can just use the up arrow key to re-run the same command, but sometimes you're typing other things into the terminal too and you don't feel like hitting the up arrow key four times in a row, and also this is just a cool and useful tip to get comfortable with aliasing so shhhh)
so, in your terminal shell, just type this:
alias run="python3 testScriptWithASuperLongName.py"
now, you can run that entire super long command, just by typing the word "run" into your terminal. Here's a screenshot of an example on my computer to make it make more sense:
Tumblr media
in this example, i just created a simple python file that contains one line of code: print("it works!")
then, as you can see, by setting the alias to run, i can now run that file, runningatestscript.py, simply with the command 'run'.
the best part is, this alias is temporary - it only lasts as long as your shell session is open. so once you close the terminal, the run alias is cleared and you can set it again next time to any file or task you're currently working on, to save yourself a lot of typing, typos, and time.
so if you want to, you can get in the habit of always setting a run alias in the VSCode terminal for whichever file you're working with as soon as you get everything open. that way, when you need to run the same file 50 million times, you have a super easy way of doing it! you can even set it to a single letter if you want to go for maximum speed, but i prefer to use whole short words, because they're easy for me to remember.
note: if you do want to set an alias to work for all sessions, you can simply add it to your ./bashrc file. this is a common way to automate repeatable tasks, and simply to set easier-to-remember commands for terminal commands that are really complicated/confusing/hard to remember.
for example, i saved the alias checkboot="[ -d /sys/firmware/efi ] && echo 'UEFI mode' || 'BIOS mode'" into my zshrc file (zsh equivalent of bashrc file). this way, no matter how many times i rebooted my machine, i would always be able to quickly check which boot mode was running by simply typing 'checkboot'.
yesterday i was updating my boot mode from BIOS to UEFI on my very old machine that is technically compatible with UEFI, but not configured for it by default. So it was extremely helpful and saved me the time and headache of having to remember and type that long-ass command a thousand times in between many different reboots and new shells.
if you have any tasks like that, or terminal commands that you know would be useful to you, but you can never remember them when you need them, i highly recommend getting comfortable with aliasing! it can be super useful to simply set custom aliases for all the commands you don't want to remember, so that you can automate things away and not have to worry about so much linux syntax all the time when you're tring to focus on programming.
i know this may seem like a simple tip to some, but i only learned about it recently and it's been extremely helpful to integrate into my workflow and customize my OS with! so i thought it might be worthwhile to some people if i share :) hope it helps!
114 notes · View notes
brightgreendandelions · 2 years ago
Text
wow, i didn't know bat could do that! i only use it to read nginx logs /j
but wouldn't it make the man page have line numbers on the side?
i just spent like an hour to solve linux problem again.. because my man page colors suddenly stopped working! and you can't have uncolorful man pages. 0_0
thankfully i had a second machine (my server) to compare outputs to..
i eventually tracked down the culprit, and it was groff being updated to version 1.23.0! seems totally unrelated to man, doesn't it¿ :)
now i have to figure out if i can solve this better than just downgrading it to 1.22.4
PS: i spent way too much time barking up the less tree, because the config variables are called LESS_TERMCAP_*
edit: you have to set the GROFF_NO_SGR environment variable to 1
50 notes · View notes
debian-official · 3 days ago
Note
what flags do you use for ls
usually none, -la when things are going wrong.
Used to use the alias la but I've not gotten around to standardizing bashrc or whatever on all my systems so I'm not doing that anymore
(i really should go do that, i am in dire need of an alias for docker ps -a with only the useful stuff so I don't have to maximize the terminal to read anything lol)
4 notes · View notes
lady-inkyrius · 2 years ago
Text
The modal editor brainrot is real; my ~/.bashrc now contains the line alias :q='exit' because I got so annoyed at typing it accidentally.
31 notes · View notes
linuxtldr · 9 months ago
Text
7 notes · View notes
emme-likes-words · 5 months ago
Text
Whenever I hop distros, I do one thing first. I add these two lines to my .bashrc:
alias gimmie='sudo pacman -S' alias begone='sudo pacman -R'
It does very little and is only slightly faster than normal, and I will do it every time.
3 notes · View notes
lunachats · 5 months ago
Text
for whatever reason my brain had been expanding the typical "rc" suffix in bashrc etc as "runtime configuration" but i guess it's actually short for "run commands"!!
6 notes · View notes
wayfire-official · 6 months ago
Text
i did a little bash thing that allows you to get the Template functionality most file explorers have within your terminal.
templ(){
FILE=$1
EXTENSION=${1#${1%\.}}
TEMPLATE=$(find ~/Templates -maxdepth 1 -type f -iname "$EXTENSION")
if [ -f "$FILE" ]; then
echo "File $FILE exists."
return 1;
fi
if [ ! -f "$TEMPLATE" ]; then
echo "No Template Found; creating blank file"
touch $FILE
return 1;
fi
cp "$TEMPLATE" "$FILE"
}
it's supposted to kinda work like an extended touch where it detects the extension and if it finds a template in ~/Templates then it just copies that over.
i wanted it because i found myself googling "[language] boilerplate" a lot recently
just copy it over to your .bashrc or source it from a seperate file, populate your Templates directory with some templates and you should be good to go.
if you have any additional ideas then please tell. i'm thinking of maybe having a couple different templates for the same extension, like java interface vs class that you have to choose but idk.
also i didn't really check to see if that kind of thing already existed, so if it does please tell me
5 notes · View notes
smartupworld · 4 months ago
Text
Setup SSL from Cpanel Terminal / Installing and Fixing SSL Issues with Let's Encrypt (acme.sh) on Linux
Step 1: Install acme.sh (if not installed) If you haven’t already installed acme.sh, do so with the following commands: bash curl https://get.acme.sh | sh Once installed, reload your shell environment to use acme.sh: bash source ~/.bashrc Alternatively, restart your session: bash exec $SHELL Step 2: Issue an SSL Certificate Using acme.sh To issue an SSL certificate for your domain (e.g.,…
0 notes
kandztuts · 7 months ago
Text
Linux CLI 25 🐧 Prompt Customization
New Post has been published on https://tuts.kandz.me/linux-cli-25-%f0%9f%90%a7-prompt-customization/
Linux CLI 25 🐧 Prompt Customization
Tumblr media
youtube
a - prompt customization intro you can customize cli prompt by editing the PS1 variable for permanent changes edit nano ~/.bashrc for BASH ~/.zshrc for Zsh and ~/.config/fish/config.fish for Fish example → PS1="TestPrompt " export PS1 and then to apply changes source ~/.bashrc but you can test and play with it temporarily by editing the PS1 on the terminal example to only show the username → PS1="\u " b - prompt escape codes Most common escape codes for shell prompt \d → current date \H → full hostname \h → hostname \n → new line character \r → carriage return \t → time in 24 hour format \@ → time in 12 hour format with AM/PM \u → username \w → working directory \W → last part of the working directory \! → history id of the command \[ → start of non-printing character sequence ]\ → end for char sequence example → shows username - working directory last c - prompt colors codes List of colors: \033[30m → Black \033[30m → Dark gray \033[31m → Red \033[31m → Light red \033[32m →Green \033[32m →Light green \033[33m → Brown \033[34m → Blue \033[34m → Light blue \033[33m → Yellow \033[35m → Purple \033[35m → Light purple \033[36m → Cyan \033[36m → Light cyan \033[37m → Light gray \033[37m → White example 1 → shows username - working directory last in purple color and then back to white d - prompt background colors and text format codes List of background colors: \033[40m → Black \033[44m → Blue \033[41m → Red \033[45m → Purple \033[42m → Green \033[46m → Cyan \033[43m → Brown \033[47m → Light gray example 1 → shows username - working directory last in purple color and white background and then back to default List of text format codes: \033[0m → Reset formatting to default. \033[1m → Bold text. \033[4m → Underline text. \033[7m → inverse example 1 → shows username - working directory last in purple color and white background, underlined and then back to default
0 notes
jvkings · 8 months ago
Photo
Tumblr media
How To Edit The BashRC File To Make Bash More Useful On Linux
0 notes
squanshy-sporraw · 14 days ago
Text
throwback to when i had bash at the end of my .bashrc for some reason and i didnt notice for months until some build scripts started failing
accidentally breaking your install in stupid and fantastic ways is enrichment for Linux users. we call it "customizing" and "tinkering", but really we are all just waiting with baited breath for the next time our tmux config somehow obliterates our home directory.
168 notes · View notes
nectoy7 · 9 months ago
Text
Setting Up the Java Environment: A Complete Guide for Beginners
Java is a powerful, widely-used programming language known for its platform independence, object-oriented principles, and robustness. One of the key reasons for its popularity is the fact that it can run on any machine equipped with a Java Virtual Machine (JVM), making it truly “write once, run anywhere.” However, before you can start writing and executing Java code, you need to properly set up the Java development environment on your system.
This guide will walk you through the entire process of setting up the Java environment, including downloading and installing the necessary tools, configuring environment variables, and writing your first Java program. By the end of this tutorial, you’ll be ready to start coding in Java.
Step 1: Understanding the Components of the Java Environment
Before diving into the installation process, it’s essential to understand the core components involved in the Java ecosystem. These include:
1. JDK (Java Development Kit): This is the complete suite needed to develop and run Java applications. It includes the Java compiler (javac), standard libraries, and other tools required to build and execute Java programs.
2. JRE (Java Runtime Environment): The JRE provides the libraries and the JVM necessary to run Java applications. It’s a part of the JDK but can also be installed separately if you’re only running (not developing) Java programs.
3. JVM (Java Virtual Machine): This is the heart of Java’s platform independence. It interprets the compiled Java bytecode and allows it to run on any operating system that has a compatible JVM.
For development, you’ll primarily need the JDK, which includes the JRE and JVM.
Step 2: Downloading and Installing the Java Development Kit (JDK)
To begin coding in Java, you need to download the JDK. Here’s how to do it:
1. Go to the Official Oracle Website:
Visit the official Oracle Java SE Downloads page.
You’ll see multiple versions of Java. For most use cases, it’s best to download the latest Long-Term Support (LTS) version, which is currently Java SE 17.
2. Choose the Right Version for Your Operating System:
Select the appropriate version based on your operating system (Windows, macOS, or Linux).
Download the installer (.exe for Windows, .dmg for macOS, or a compressed package for Linux).
3. Run the Installer:
For Windows:
Double-click the .exe file and follow the installation prompts. The default installation directory is usually C:\Program Files\Java\jdk-<version>.
For macOS:
Open the .dmg file, and drag the JDK into your Applications folder.
For Linux:
Extract the downloaded .tar.gz file into a directory, and follow the system-specific instructions for installation.
Step 3: Configuring Environment Variables
Once the JDK is installed, you need to configure the PATH and JAVA_HOME environment variables on your system. This allows your terminal or command prompt to access Java’s tools from any directory.
Windows
1. Open Environment Variables:
Right-click on This PC or My Computer and choose Properties.
Click on Advanced System Settings, then click Environment Variables.
2. Set JAVA_HOME:
In the System Variables section, click New.
Set the variable name as JAVA_HOME and the variable value as the path to your JDK installation (e.g., C:\Program Files\Java\jdk-17).
3. Update PATH Variable:
In the System Variables section, find the Path variable, select it, and click Edit.
Click New and add %JAVA_HOME%\bin.
Click OK to close all dialogs.
macOS
1. Open the Terminal and edit your shell profile (e.g., .bash_profile or .zshrc for Zsh) by typing:
nano ~/.bash_profile
2. Set JAVA_HOME and Update PATH: Add the following lines:
export JAVA_HOME=$(/usr/libexec/java_home) export PATH=$JAVA_HOME/bin:$PATH
3. Save and Exit:
Press Ctrl+X to exit, then Y to save changes.
Apply the changes with:
source ~/.bash_profile
Linux
1. Open Terminal and edit your shell profile (e.g., .bashrc or .zshrc) by typing:
nano ~/.bashrc
2. Set JAVA_HOME and Update PATH: Add the following lines:
export JAVA_HOME=/usr/lib/jvm/jdk-17 export PATH=$JAVA_HOME/bin:$PATH
3. Save and Exit:
Press Ctrl+X to exit, then Y to save.
Apply the changes:
source ~/.bashrc
Step 4: Verifying the Installation
Once you’ve installed the JDK and configured the environment variables, verify that everything is set up correctly.
1. Open a Terminal or Command Prompt:
On Windows, press Windows + R, type cmd, and press Enter.
On macOS and Linux, open the Terminal from your applications or press Ctrl+Alt+T (for Linux).
2. Check the Java Version: Type the following command:
java -version
You should see output similar to:
java version “17.0.2” 2022-01-18 LTS Java(TM) SE Runtime Environment (build 17.0.2+8-86) Java HotSpot(TM) 64-Bit Server VM (build 17.0.2+8-86, mixed mode)
3. Check the Java Compiler: Similarly, check if the Java compiler (javac) is working by typing:
javac -version
The output should be something like:
javac 17.0.2
Step 5: Writing and Running Your First Java Program
With the Java environment properly set up, it’s time to write your first Java program. Follow these steps:
1. Open a Text Editor: You can use any text editor like Notepad (Windows), TextEdit (macOS), or Vim/Nano (Linux). Alternatively, you can use an Integrated Development Environment (IDE) like Eclipse, IntelliJ IDEA, or NetBeans for a more user-friendly experience.
2. Write the Program: Here’s a simple “Hello, World!” program:
public class HelloWorld {     public static void main(String[] args) {         System.out.println(“Hello, World!”);     } }
3. Save the File: Save the file as HelloWorld.java in a directory of your choice.
4. Compile the Program: Open the terminal or command prompt and navigate to the directory where you saved the file. Use the following command to compile the program:
javac HelloWorld.java
If there are no errors, this will generate a file called HelloWorld.class.
5. Run the Program: Now, run the compiled program by typing:
java HelloWorld
You should see the following output:
Hello, World!
Step 6: Installing an IDE (Optional)
While it’s possible to write and run Java programs using just a text editor and the terminal, using an Integrated Development Environment (IDE) can make the process much easier, especially as your programs become more complex.
Some popular IDEs for Java development are:
Eclipse: A widely-used IDE with many plugins to enhance functionality.
IntelliJ IDEA: A powerful IDE with smart coding assistance, refactoring tools, and an intuitive interface.
NetBeans: A free and open-source IDE with support for various programming languages, including Java.
You can download these IDEs from their official websites and install them by following the provided instructions.
Conclusion
Setting up the Java environment may seem complicated at first, but once you’ve gone through these steps, you’ll be ready to dive into Java development. From here, you can start writing basic programs, experimenting with object-oriented concepts, and eventually tackling larger projects. Whether you’re developing desktop applications, web services, or Android apps, learning Java will give you a solid foundation in programming.
1 note · View note