Skip to content

Instantly share code, notes, and snippets.

View 173duprot's full-sized avatar

1 7 3 dup rot 173duprot

View GitHub Profile
@fogus
fogus / 0 - UNIX Fifth Edition
Created July 20, 2011 00:15
UNIX V5, OpenBSD, Plan 9, FreeBSD, and GNU coreutils implementations of echo.c
main(argc, argv)
int argc;
char *argv[];
{
int i;
argc--;
for(i=1; i<=argc; i++)
printf("%s%c", argv[i], i==argc? '\n': ' ');
}
@PhirePhly
PhirePhly / Makefile
Created June 12, 2012 03:12
A crazy simple SMTP server, for educational purposes only.
default:
cc ccsmtp.c -o ccsmtpd -lpthread
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@willurd
willurd / web-servers.md
Last active November 13, 2024 13:44
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@rofl0r
rofl0r / init.c
Created August 6, 2013 21:15
minimal init daemon by rich felker, author of musl libc
#define _XOPEN_SOURCE 700
#include <signal.h>
#include <unistd.h>
int main()
{
sigset_t set;
int status;
if (getpid() != 1) return 1;
@mayank
mayank / smtp.c
Created November 12, 2013 23:53
SMTP File Transfer using C
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <netdb.h> /* gethostbyname */
#include <netinet/in.h> /* htons */
#include <sys/socket.h>
#include <sys/types.h>
@bkaradzic
bkaradzic / orthodoxc++.md
Last active November 15, 2024 12:57
Orthodox C++

Orthodox C++

What is Orthodox C++?

Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

Why not Modern C++?

anonymous
anonymous / IRC client in pure bash 4
Created March 28, 2016 16:57
IRC client written in pure bash using only bash builtin commands and no other binaries.
#!/bin/bash
#no PATH, no way to accidently run any programs
PATH=''
#useful variables
term_height=0
term_width=0
term_scroll_height=0
status_line_row=0
@CSaratakij
CSaratakij / .tmux.conf
Last active June 22, 2024 08:10
Tmux's Config that's very close to i3wm (Setting with an idea of using tmux without x-server)
# Config that is very close to a i3 window manager's keybinding.
set -s escape-time 0
setw -g aggressive-resize on
# First remove *all* keybindings
unbind-key -a
# List keys
bind-key ? list-keys
@calaveraInfo
calaveraInfo / README.md
Last active January 27, 2021 05:29
Simple tool that redirects it's standard input to input buffer of a terminal (i.e. fake input to some terminal)

About

It is possible to redirect some input to TTY device by standard IO redirection.

echo ahoj > /dev/tty1

Such redirection will however end in the output buffer of the TTY device so the characters will be ghosts - visible on the terminal, but not effective. It is, in fact, not possible by standard tools to redirect input to terminal as if it is a real input from keyboard.