Skip to content

Instantly share code, notes, and snippets.

View lucasmezencio's full-sized avatar
:bowtie:
Neeeeeeeeerd

Lucas Mezêncio lucasmezencio

:bowtie:
Neeeeeeeeerd
View GitHub Profile
@lucasmezencio
lucasmezencio / gist:2629006
Created May 7, 2012 17:06
Which Linux Distro?
cat /etc/redhat-release #will show you information for red hat based distros.
cat /etc/SuSE-release #for SUSE based distros.
cat /etc/mandrake-release #for mandrake distros.
cat /etc/debian_version #for debian based distros.
cat /etc/UnitedLinux-release #might also return some more information.
@lucasmezencio
lucasmezencio / overthinking.txt
Last active February 25, 2019 13:53
Overthinking
This problem can be solved by pre-school children in
five to ten minutes, by programmers in a hour and by
people with higher education... well, check it yourself!
8809 = 6 5555 = 0
7111 = 0 8193 = 3
2172 = 0 8096 = 5
6666 = 4 1012 = 1
1111 = 0 7777 = 0
3213 = 0 9999 = 4
@lucasmezencio
lucasmezencio / problema_c.cpp
Last active May 22, 2019 11:58
Problema C
/**
* Make this program to print 13 making changes ONLY the body of the "function" function
* You are NOT ALLOWED to change NOTHING in the "main" function
*/
void function() {
/* EDIT ONLY HERE */
}
int main() {
@lucasmezencio
lucasmezencio / commands.php
Created April 25, 2012 13:12
Command Interpreter Example
<?php
require_once __DIR__.'/functions.php';
$commands = array(
'hello' => array(
'params' => array('name')
),
'dump' => array(
'params' => array('var')
)
@lucasmezencio
lucasmezencio / gist:2474232
Created April 23, 2012 22:15
Resolução problema C
/**
* Faça este programa imprimir 13 alterando APENAS o corpo da função "function"
* NÃO VALE ALTERAR NADA NA FUNÇÃO main
*/
void function() {
printf("%d\n", 13);
exit(0);
}
@lucasmezencio
lucasmezencio / gist:2030094
Created March 13, 2012 17:34
Using screen for background commands
# Create the screen session
screen -dR some_screen_name
# Use ctrl+a, d to detatch the session from screen
# To view the screen session, use:
screen -ls
# To came back the screen session, use:
screen -r some_screen_name
# If you have only one screen session, you can use just:
screen -r