Skip to content

Commit

Permalink
Added articles :D
Browse files Browse the repository at this point in the history
  • Loading branch information
404salad committed Feb 17, 2024
1 parent 8c0b9a5 commit 563e662
Show file tree
Hide file tree
Showing 22 changed files with 352 additions and 503 deletions.
4 changes: 2 additions & 2 deletions cli/config.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Hi! this is a minimal config file for pond

author_name = 'Your Name Here (Edit this in config.toml)'
blog_name = 'Blog Name (Edit this in config.toml)'
author_name = 'Sahil Upasane'
blog_name = '404salads Croutons'

# supported accent colors thanks to pico :D
# default amber blue cyan fuchsia green grey indigo jade lime orange pink pumpkin purple red sand slate violet yellow zinc
Expand Down
32 changes: 32 additions & 0 deletions cli/content/Cronjobs.md
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 |


56 changes: 56 additions & 0 deletions cli/content/Debugging C++ Programs with GDB.md
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!!!

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!
62 changes: 62 additions & 0 deletions cli/content/Makefiles:).md
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!
44 changes: 0 additions & 44 deletions cli/content/sample (3rd copy).md

This file was deleted.

42 changes: 0 additions & 42 deletions cli/content/sample (4th copy).md

This file was deleted.

42 changes: 0 additions & 42 deletions cli/content/sample (5th copy).md

This file was deleted.

42 changes: 0 additions & 42 deletions cli/content/sample (6th copy).md

This file was deleted.

Loading

0 comments on commit 563e662

Please sign in to comment.