add prompts and knowledge files
This commit is contained in:
parent
2e8d482940
commit
18c36419dc
16 changed files with 516 additions and 0 deletions
16
data/knowledge/c-programming.txt
Normal file
16
data/knowledge/c-programming.txt
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
C is a general-purpose programming language created by Dennis Ritchie at Bell Labs in 1972.
|
||||
C is the lingua franca of operating systems and embedded systems programming.
|
||||
The C standard library provides functions for input/output string manipulation memory allocation and more.
|
||||
Pointer arithmetic is one of the most powerful and dangerous features of C.
|
||||
Undefined behavior in C includes buffer overflows null pointer dereferences and signed integer overflow.
|
||||
Memory safety is the programmer's responsibility in C unlike in managed languages.
|
||||
The Linux kernel is written almost entirely in C with some assembly for low-level operations.
|
||||
sizeof operator returns the size of a type or object in bytes.
|
||||
malloc calloc realloc and free are the primary memory management functions.
|
||||
String handling in C uses null-terminated character arrays with functions like strcpy strlen strcmp.
|
||||
C99 C11 C17 and C23 are the major standards versions with varying levels of compiler support.
|
||||
Pointers are variables that store memory addresses and allow direct memory manipulation.
|
||||
Function pointers enable callbacks and dynamic dispatch in C.
|
||||
The preprocessor handles directives like include define and ifdef before compilation.
|
||||
Static analysis tools like lint cppcheck and coverity catch common C programming errors.
|
||||
Buffer overflows are still the most common security vulnerability in C code after decades.
|
||||
15
data/knowledge/code-complete.txt
Normal file
15
data/knowledge/code-complete.txt
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
Code Complete by Steve McConnell is a practical guide to software construction.
|
||||
Variable naming is crucial: a name should describe what the variable represents not the programmer.
|
||||
Good names are specific pronounceable and searchable avoiding ambiguous abbreviations.
|
||||
The primary goal of the software designer is to minimize complexity for human understanding.
|
||||
Structured programming uses sequence selection and iteration as the fundamental control flow constructs.
|
||||
Information hiding is the principle of encapsulating design decisions that are likely to change.
|
||||
Design patterns are recurring solutions to common software design problems.
|
||||
Coupling measures how dependent modules are on each other low coupling is desirable.
|
||||
Cohesion measures how related the elements within a module are high cohesion is desirable.
|
||||
Defensive programming anticipates errors and handles them gracefully rather than crashing.
|
||||
Assertions document assumptions in code and catch bugs during development.
|
||||
The cost of fixing defects increases exponentially the later in the development cycle they are found.
|
||||
Code reviews are one of the most cost effective methods for finding defects.
|
||||
Testing can reveal the presence of bugs but not their absence as Dijkstra noted.
|
||||
Refactoring improves code structure without changing its external behavior performed in small steps.
|
||||
15
data/knowledge/cs-quotes.txt
Normal file
15
data/knowledge/cs-quotes.txt
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
Debugging is twice as hard as writing the code in the first place.
|
||||
If you automate a mess you get an automated mess.
|
||||
Measuring programming progress by lines of code is like measuring aircraft building progress by weight.
|
||||
There are only two hard things in computer science: cache invalidation and naming things.
|
||||
Walking on water and developing software from a specification are easy if both are frozen.
|
||||
Software is a gas it expands to fill its container.
|
||||
Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
|
||||
First learn computer science and all the theory. Next learn a programming style. Then forget all that and just hack.
|
||||
The best programs are written so that computing agents can perform them efficiently and people can read them easily.
|
||||
Premature optimization is the root of all evil.
|
||||
The most dangerous phrase in the language is we have always done it this way.
|
||||
Computers are incredibly fast accurate and stupid. Human beings are incredibly slow inaccurate and brilliant. Together they are powerful beyond imagination.
|
||||
If debugging is the process of removing software bugs then programming must be the process of putting them in.
|
||||
The first 90 percent of the code accounts for the first 90 percent of the development time. The remaining 10 percent of the code accounts for the other 90 percent of the development time.
|
||||
It has been said that the great scientific disciplines are examples of giants standing on the shoulders of other giants. In software development it has always been more like dwarves standing on the toes of other dwarves.
|
||||
20
data/knowledge/gentoo.txt
Normal file
20
data/knowledge/gentoo.txt
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
Gentoo is a source based Linux distribution using the Portage package management system.
|
||||
Portage is a package management system inspired by the BSD ports collection written in Python.
|
||||
emerge is the command line interface for Portage used to install and manage packages.
|
||||
USE flags are configuration options in Gentoo that control which features are compiled into packages.
|
||||
Gentoo uses ebuild scripts which contain build instructions for each package.
|
||||
CFLAGS and CXXFLAGS are compiler optimization flags that Gentoo users customize for their system.
|
||||
The Gentoo handbook provides comprehensive documentation for installation and configuration.
|
||||
Gentoo is known for extreme configurability allowing users to optimize every aspect of their system.
|
||||
Installing Gentoo typically requires several hours to days depending on system hardware.
|
||||
The Gentoo community is known for technical expertise and strict adherence to documentation.
|
||||
Arch Linux uses binary packages while Gentoo compiles from source for maximum optimization.
|
||||
Gentoo supports multiple init systems including OpenRC and systemd.
|
||||
Kernel compilation in Gentoo is a manual process where users configure every option.
|
||||
Gentoo is recommended for advanced users who want complete control over their system.
|
||||
paludis is an alternative package manager to Portage offering different design choices.
|
||||
Gentoo Prefix allows installing Gentoo on non Linux operating systems like macOS.
|
||||
Funtoo is a fork of Gentoo focused on performance and community driven development.
|
||||
Calculate Linux is a Gentoo based distribution aimed at ease of use and corporate deployment.
|
||||
Gentoo benefits include performance optimization customizability and learning experience.
|
||||
The gentoo wiki contains extensive documentation for installation configuration and troubleshooting.
|
||||
19
data/knowledge/gnu-linux.txt
Normal file
19
data/knowledge/gnu-linux.txt
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
GNU stands for GNU Not Unix, a recursive acronym created by Richard Stallman in 1983.
|
||||
The GNU project created the essential toolchain: gcc gdb binutils glibc coreutils.
|
||||
The Free Software Foundation founded by Stallman promotes copyleft licensing like GPL.
|
||||
Linux is the kernel but GNU utilities make up the core user land of most distributions.
|
||||
GCC supports C C++ Ada Fortran Go and many other languages with optimization passes.
|
||||
GDB allows inspecting memory registers and breakpoints of running or crashed programs.
|
||||
GLIBC is the GNU C Library providing the standard C API for Linux programs.
|
||||
The GNU General Public License version 2 and 3 are the most common free software licenses.
|
||||
POSIX is a family of standards for maintaining compatibility between operating systems.
|
||||
The Filesystem Hierarchy Standard defines the directory structure on Linux systems.
|
||||
A Linux distribution combines the kernel GNU tools package manager and desktop environment.
|
||||
Systemd has replaced SysV init on most distributions for service management and boot process.
|
||||
Flatpak Snap and AppImage provide containerized application distribution for Linux.
|
||||
Docker uses Linux kernel features like cgroups and namespaces for container isolation.
|
||||
Wayland is replacing X11 as the display server protocol on modern Linux desktops.
|
||||
The proc filesystem exposes kernel data structures as a virtual filesystem at /proc.
|
||||
The sysfs filesystem exposes kernel objects and attributes at /sys.
|
||||
eBPF allows running sandboxed programs in the Linux kernel without changing kernel source.
|
||||
Linux runs on everything from embedded devices to supercomputers dominating the cloud market.
|
||||
22
data/knowledge/linux-commands.txt
Normal file
22
data/knowledge/linux-commands.txt
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
Arch Linux package management uses pacman: pacman -Syu to update, pacman -S to install, pacman -R to remove.
|
||||
pacman -Qdt lists orphaned packages, pacman -Sc clears package cache.
|
||||
systemctl start|stop|restart|enable|disable|status service name to control systemd services.
|
||||
journalctl -xe shows detailed system logs, journalctl -u service name shows service logs.
|
||||
grep -r pattern searches recursively, grep -i ignores case, grep -v inverts match.
|
||||
find /path -name pattern -type f finds files, find with -exec runs commands on results.
|
||||
netstat -tulpn shows listening ports, ss -tulpn is the modern replacement.
|
||||
ps aux shows processes, top and htop show real time process information.
|
||||
chmod changes permissions, chown changes owner, chgrp changes group.
|
||||
ln -s creates symbolic links, mount mounts filesystems, umount unmounts.
|
||||
tar -xvf extracts, tar -cvf creates, tar -tvf lists contents of tar archives.
|
||||
awk and sed are powerful text processing tools for scripting and one-liners.
|
||||
iptables and nftables configure Linux firewall rules and packet filtering.
|
||||
perf top shows real time performance analysis of running processes.
|
||||
strace traces system calls of a process, ltrace traces library calls.
|
||||
valgrind detects memory leaks and memory errors in compiled programs.
|
||||
gcc -Wall -Wextra -Wpedantic enables all compiler warnings for C programs.
|
||||
make builds projects from Makefiles, cmake is a cross platform build system generator.
|
||||
git init creates a repository, git clone copies one, git commit saves changes.
|
||||
lspci lsusb lscpu lsblk display hardware information from sysfs and udev.
|
||||
dmesg shows kernel ring buffer messages for hardware and driver debugging.
|
||||
sysctl modifies kernel parameters at runtime, /proc and /sys expose kernel internals.
|
||||
11
data/knowledge/linux-kernel.txt
Normal file
11
data/knowledge/linux-kernel.txt
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
The Linux kernel is a free and open-source monolithic Unix-like operating system kernel.
|
||||
Linus Torvalds conceived and created the Linux kernel in 1991.
|
||||
The kernel is written in C with some architecture-specific parts in assembly.
|
||||
Linux supports thousands of device drivers and runs on nearly all architectures.
|
||||
The kernel uses a monolithic architecture with loadable kernel modules.
|
||||
System calls are the interface between user space and kernel space.
|
||||
The kernel manages processes memory filesystems devices networking and security.
|
||||
Key subsystems: process scheduler memory management virtual filesystem network stack device drivers.
|
||||
The scheduler uses Completely Fair Scheduling (CFS) with O(1) complexity.
|
||||
Memory management uses paging with 4KB page size on most architectures.
|
||||
The kernel: something between an academic exercise and a technical masterpiece depending on who you ask.
|
||||
18
data/knowledge/security.txt
Normal file
18
data/knowledge/security.txt
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
Buffer overflow occurs when a program writes more data to a buffer than it can hold.
|
||||
Format string vulnerabilities allow reading and writing arbitrary memory locations.
|
||||
SQL injection happens when untrusted input is concatenated into SQL queries.
|
||||
Cross-site scripting (XSS) injects malicious scripts into web pages viewed by others.
|
||||
Privilege escalation exploits bugs to gain higher level access than authorized.
|
||||
Race conditions occur when the timing of events affects program behavior in unintended ways.
|
||||
Integer overflow wraps around to negative or small values causing logic errors.
|
||||
Use-after-free vulnerabilities access memory after it has been freed causing corruption.
|
||||
ASLR randomizes memory addresses to make exploitation more difficult.
|
||||
Stack canaries protect against stack buffer overflows by detecting corruption before return.
|
||||
NX bit marks memory pages as non-executable preventing code execution in data regions.
|
||||
Kernel exploits target vulnerabilities in the operating system kernel for full system compromise.
|
||||
The heartbleed bug in OpenSSL allowed reading memory from servers without authentication.
|
||||
Spectre and Meltdown are CPU vulnerabilities that leak information through side channels.
|
||||
The principle of least privilege says code should run with only the permissions it needs.
|
||||
Defense in depth uses multiple layers of security controls so no single failure is catastrophic.
|
||||
Zero day vulnerabilities are unknown to the vendor and have no available patch.
|
||||
A threat model identifies potential attackers their capabilities and the assets they target.
|
||||
15
data/knowledge/taocp.txt
Normal file
15
data/knowledge/taocp.txt
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
The Art of Computer Programming by Donald E. Knuth. Multi-volume work on algorithms and programming.
|
||||
Volume 1: Fundamental Algorithms covers basic concepts data structures and mathematical preliminaries.
|
||||
Volume 2: Seminumerical Algorithms covers random number generation and arithmetic.
|
||||
Volume 3: Sorting and Searching covers sorting algorithms like quicksort merge sort heap sort.
|
||||
Volume 4A: Combinatorial Algorithms covers combinatorial searching and backtracking.
|
||||
Knuth developed the concept of literate programming where programs are written as works of literature.
|
||||
The book uses MIX an abstract machine architecture that Knuth designed for teaching.
|
||||
Later editions replaced MIX with MMIX a modern RISC architecture.
|
||||
Knuth offers a reward for finding errors in his books starting at 2.56 and doubling each year.
|
||||
The books are known for their rigorous mathematical analysis of algorithm complexity.
|
||||
Knuth created TeX and METAFONT for typesetting mathematical and technical documents.
|
||||
Analysis of algorithms uses O notation for asymptotic upper bounds and Theta for tight bounds.
|
||||
The study of algorithms is the foundation of computer science and software engineering.
|
||||
Algorithm analysis considers time complexity space complexity and optimality proofs.
|
||||
Sorting networks permutation generation and tree structures are fundamental data organization methods.
|
||||
26
data/knowledge/windows.txt
Normal file
26
data/knowledge/windows.txt
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
Windows NT kernel is a hybrid kernel designed by Microsoft. NT stands for New Technology.
|
||||
Windows 10 and 11 are the latest consumer versions of the Windows operating system.
|
||||
PowerShell is a task automation and configuration management program from Microsoft.
|
||||
Active Directory is a directory service for Windows domain networks used for authentication.
|
||||
Group Policy provides centralized management of user and computer settings in AD.
|
||||
.NET Framework and .NET Core are Microsofts managed code frameworks for Windows applications.
|
||||
DirectX is a collection of application programming interfaces for multimedia and gaming on Windows.
|
||||
Win32 API is the core set of APIs for Windows application development.
|
||||
Windows Subsystem for Linux allows running Linux binaries natively on Windows.
|
||||
Azure is Microsofts cloud computing platform for building and deploying applications.
|
||||
Visual Studio is an integrated development environment from Microsoft for many languages.
|
||||
NTFS is the primary filesystem for Windows with journaling and encryption support.
|
||||
BitLocker provides full disk encryption for Windows operating system drives.
|
||||
Hyper-V is Microsofts hypervisor for creating and managing virtual machines on Windows.
|
||||
Windows Hello provides biometric authentication on supported Windows devices.
|
||||
Remote Desktop Protocol allows connecting to Windows machines over network connections.
|
||||
Task Scheduler automates repetitive tasks on Windows operating systems.
|
||||
Windows Registry is a hierarchical database storing configuration settings for Windows.
|
||||
MSI Installer is the standard package format for software installation on Windows.
|
||||
COM and COM+ are component object models for interprocess communication on Windows.
|
||||
Windows Server provides enterprise grade server capabilities with roles and features.
|
||||
IIS is Microsofts web server for hosting websites and web applications on Windows.
|
||||
SQL Server is Microsofts relational database management system for enterprise data.
|
||||
Microsoft 365 integrates Office apps with cloud services for productivity.
|
||||
Windows has the largest software ecosystem of any desktop operating system.
|
||||
Backward compatibility is a core design principle of Windows spanning decades.
|
||||
Loading…
Add table
Add a link
Reference in a new issue