Skip to content

Instantly share code, notes, and snippets.

-- A web server in ~60 lines of Lua. Not counting utils. (Yes they are great utils.)
-- We're not faking this tho: The utils actually know nothing about HTTP.
-- We find out what port we should use. By default we use port 80 because we are REALLY hottish motherfuckers.
port = arg[1] or 80
-- We import ourselves some great socket server maker tool.
require 'lib_genericsocketserver'
sources = {debug.getinfo(1).source:sub(2), 'lib_genericsocketserver.lua', 'lib_stefansutils.lua'}
@TheAnonymous
TheAnonymous / Bcache Tutorial
Last active April 21, 2019 03:46
Making a SSD working as a Cache for a HDD with bcache.
There are 3 Methods for using a SSD as cache.
dm-cache, bcache,enhance-io all three should be avaliable in Kernel Version 3.10.
Performance differenceses are discussed here => http://lkml.indiana.edu/hypermail/linux/kernel/1306.1/01246.html
In this tutorial I will use bcache since dm-cache didn't worked for me.
At the moment there is only an rc5 candidate for kernel 3.10.0
How to compile it is explained below. If you have a newer kernel than 3.10 and it is bcache enabled you dont need to compile it by yourself. In this case just jump over the kernel-compile-exlanation. If your kernel is compiled with bcache support you can test with "modprobe bcache". If that doesnt throw an error it should work :)
I will link to the tutorials I used. If you found better ones please paste a link in the comments
How to compile a kernel by yourself is explained at:
=> http://bodhizazen.net/Tutorials/kernel
@teffalump
teffalump / README.md
Last active June 16, 2024 18:43
OpenWRT adblock implementation

Others have recently developed packages for this same functionality, and done it better than anything I could do. Use the packages instead of this script:

Description

In its basic usage, this script will modify the router such that blocked addresses are null routed and unreachable. Since the address blocklist is full of advertising, malware, and tracking servers, this setup is generally a good thing. In addition, the router will update the blocklist weekly. However, the blocking is leaky, so do not expect everything to be blocked.

@JosefJezek
JosefJezek / proxmox-ve.md
Last active January 11, 2021 20:38
Proxmox VE
@roachhd
roachhd / README.md
Created December 8, 2014 23:09
Games on GitHub

Games on GitHub

Below is a list of open source games and game-related projects that can be found on GitHub - old school text adventures, educational games, 8-bit platform games, browser-based games, indie games, GameJam projects, add-ons/maps/hacks/plugins for commercial games, libraries, frameworks, engines, you name it.

Contributing

If you'd like to add a repository to the list, please create an Issue, or fork this repository and submit a pull request.

Help: MarkDown Help, Markdown Cheatsheet

@werbet
werbet / listas.markdown
Created August 25, 2015 12:56
Lista Prática de Algoritmos

Lista Prática 1

  1. Dada uma seqüência de números inteiros não-nulos, seguida por 0, imprimir seus quadrados.

  2. Dado um número inteiro positivo n, calcular a soma dos n primeiros números naturais.

  3. Dado um número inteiro positivo n, imprimir os n primeiros naturais ímpares. Exemplo: Para n=4 a saída deverá ser 1,3,5,7.

  4. Dados um inteiro "x" e um inteiro não-negativo "n", calcular "x" elevado a "n".

Downloading and Syncing Archive.org Collections

Following are instructions on how to use the Internet Archive command-line tool, "ia", to download a collection from Archive.org and keep it synced. The only requirements are that you have Python 2 installed on a Unix-like operating system (i.e. Mac OS X, Linux).

Downloading and Configuring the Ia Command-Line Tool

  1. Download the latest binary of the ia command-line tool:

emacs --daemon to run in the background. emacsclient.emacs24 <filename/dirname> to open in terminal

NOTE: "M-m and SPC can be used interchangeably".

  • Undo - C-/
  • Redo - C-?
  • Change case: 1. Camel Case : M-c 2. Upper Case : M-u
  1. Lower Case : M-l
@bernbecht
bernbecht / workflow.md
Last active June 17, 2022 12:41
Lua Front-end Wrokflow

Front-end workflow v1.0

Topics

 - Preprocessor;
 - Task runner;
 - Scaffolding;
 - Code style;
  • Pendências da documentação
@adham90
adham90 / spacemacs-keybindings
Last active April 5, 2024 14:24
spacemacs keybindings that i need to learn
SPC s c remove highlight
**** Files manipulations key bindings
Files manipulation commands (start with ~f~):
| Key Binding | Description |
|-------------+----------------------------------------------------------------|
| ~SPC f c~ | copy current file to a different location |
| ~SPC f C d~ | convert file from unix to dos encoding |
| ~SPC f C u~ | convert file from dos to unix encoding |