-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
352 additions
and
503 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
> running stuff in the background at a specified time is awesome | ||
I forget to backup my files and so i use cron to do it for me. | ||
|
||
Here is a basic rundown- | ||
- crontab is the tab of all cronjobs | ||
- run `crontab -e` it will ask for setup, use your favorite editor | ||
|
||
``` | ||
export EDITOR=nvim | ||
``` | ||
|
||
now run `crontab -e` again and you should be able to access the file | ||
``` | ||
# Add this line to your crontab file to run the backup every day at 2 AM | ||
0 2 * * * rsync -ah --info=progress2 /path/to/source /path/to/destination | ||
``` | ||
those asterics are wildcards! It means run it everytime | ||
|
||
use this command format examples for cronjobs | ||
|
||
|m | h | dom | mon | dow | command | | ||
|---------|----------|----------|----------|----------|----------| | ||
| minutes | hours | day | month | day of the week | command | | ||
|30 | 4 | * | * | 6 | 4:30 every Saturday | | ||
|15 | 14 | * | * | * | 2:15 every day | | ||
|0 | 0 | * | * | 0 | 12:00 AM every Sunday | | ||
|30 | 8 | * | * | 1-5 | 8:30 AM every weekday | | ||
|45 | 3 | 10 | * | * | 3:45 AM on the 10th | | ||
|59 | 23 | 31 | 12 | * | 11:59 PM on December 31st | | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
|
||
If you don't use GDB but program in C/C++, you are missing out on a powerful debugging tool. Here's a quick 5-minute tutorial to get you started. | ||
|
||
## Step 1: Compile with Debug Symbols | ||
|
||
Compile your program using the `-ggdb` flag to include debug symbols for GDB. | ||
|
||
```bash | ||
# For C++ | ||
g++ main.cpp -o main -ggdb | ||
|
||
# For C | ||
gcc main.c -o main -ggdb | ||
``` | ||
|
||
## Step 2: Run GDB | ||
|
||
Now, run GDB from the shell, pointing it to your compiled executable. | ||
|
||
```bash | ||
gdb ./main | ||
``` | ||
|
||
(Note: If you aren't using Linux, at least consider using WSL (Windows Subsystem for Linux) for a better debugging experience.) | ||
|
||
You will see the `(gdb)` prompt. | ||
|
||
## Step 3: Basic GDB Commands | ||
|
||
- Type `run` to execute your program. | ||
- Use `break` followed by a line number or function name to set breakpoints. | ||
- Type `n` to step through the code line by line. | ||
|
||
## Step 4: Visualize Code with `layout split` | ||
|
||
One helpful feature is the split layout, which displays both the source code and GDB commands simultaneously. | ||
|
||
```bash | ||
layout split | ||
``` | ||
|
||
## Step 5: Inspecting Variables | ||
|
||
Use the `print` and `display` commands in GDB to inspect variables and expressions during debugging. | ||
|
||
For example: | ||
|
||
```bash | ||
print variable_name | ||
display expression | ||
``` | ||
|
||
These commands help you check if anything is unexpected in your program. | ||
|
||
Now go practice!!! | ||
|
20 changes: 20 additions & 0 deletions
20
cli/content/Every Programmer Should Watch Conference Talks on YouTube.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
I was going to write a longer article to convince everyone to watch the conferences but Its much better to give a summary of my favorite talks and hopefully that will be persuasive enough~ | ||
|
||
### ["The Tragedy of systemd" - Benno Rice](https://www.youtube.com/watch?v=o_AIw9bGogo) | ||
In an age where it is cool to not like systemd Benno Rice comes with an unique perspective having been a FreeBSD developer. He is a legend in the industry and made me realize the importance of change. | ||
|
||
### ["Rust Before Main" - Ryan Levick](https://www.youtube.com/watch?v=q8irLfXwaFM) | ||
Before learning assembly I didn't think about how compilation and machine instructions work. This talk helped me understand Rust internals and appreciate them. | ||
|
||
### ["Lychee - writing a fast, async link checker in Rust" - Matthias Endler](https://www.youtube.com/watch?v=BIguvia6AvM) | ||
Software is hard and the web is broken. if you don't understand this you will after this talk. | ||
|
||
### ["The foundations of the Elixir type system" - José Valim](https://www.youtube.com/watch?v=BIguvia6AvM) | ||
I AM SO EXCITED FOR THE ELIXIR TYPE SYSTEM, just had to get that out of my chest. Elixir is my favorite functional programming language I love the syntax and community. Who better than José Valim himself to tell you about his programming language! Trust me you will love this regardless of whether you know elixir or not. | ||
|
||
### ["What UNIX Cost Us" - Benno Rice ](https://www.youtube.com/watch?v=9-IWMbJXoLM) | ||
Benno Rice with another classic. | ||
|
||
--- | ||
|
||
Most of the knowledge in software engineering is super difficult to gain solely by personal experience, I hope these talks inspire you and you explore further! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
## Quick and Easy Makefile Guide | ||
|
||
|
||
Begin by crafting a file named `Makefile` – the control center for your project's build rules. | ||
|
||
|
||
|
||
In your Makefile, set up a rule like this: | ||
|
||
```makefile | ||
target: dependencies | ||
command | ||
``` | ||
|
||
- **`target`:** Your desired output, like an executable. | ||
- **`dependencies`:** Files needed for building. | ||
- **`command`:** The action to build from dependencies. | ||
|
||
|
||
|
||
For a straightforward C program, a rule might look like: | ||
|
||
```makefile | ||
app: main.c utils.c | ||
gcc main.c utils.c -o app | ||
``` | ||
|
||
This rule compiles `main.c` and `utils.c` into an executable named `app`. | ||
|
||
|
||
|
||
Navigate to your terminal, hop into the Makefile's directory, and type: | ||
|
||
```bash | ||
make | ||
``` | ||
|
||
Watch the magic unfold as Make executes your rules, compiling your program seamlessly. | ||
|
||
|
||
|
||
Make automagically tracks file dependencies. Change a source file, and only the necessary parts get recompiled on the next `make` run. | ||
|
||
|
||
|
||
Incorporate variables for flexibility: | ||
|
||
```makefile | ||
CC=gcc | ||
app: main.c utils.c | ||
$(CC) main.c utils.c -o app | ||
``` | ||
|
||
Now, altering compilers is a breeze – just tweak the `CC` variable. | ||
|
||
|
||
|
||
As your project evolves, dig into advanced features like functions, automatic variables, and built-in rules. | ||
|
||
|
||
|
||
Makefiles offer a practical way to automate your build process. This guide gets you started smoothly. As you dive deeper, explore extra features to fine-tune and customize your project's build flow! |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.