Too Cool for Internet Explorer


Swobodin's Profile | Swobodin's Blog | Back to Fedora Tunisia

Archive for the 'C' Category

Malicious program

Wednesday, November 9th, 2005

Wakegen dropped me that C program that crashes your UNIX machine.
Be careful! It’s dangerous, use it at your own risk
#include <sys/types.h>
#include <unistd.h>
int main() {
pid_t p=fork();
main();
}
It consists of the following: Creating infinte child processus until the buffer gets overloaded; […]

aid_mabruk.c

Friday, November 4th, 2005

Received this SMS from Hussemus:
#include <life.h>
#define AID_MABROUK 1
int main(int argc, char *argv[]) {
int happiness = 0;
while (happiness < MAX_INT) {
happiness++;
}
return AID_MABROUK;
}
The code, however needs to be patched, since MAX_INT is undefined, and a compilation error may occur!

Vim Macros

Monday, October 31st, 2005

Here are some interesting Vim macros you can put on your ~/.vimrc :
To make get an insensitive and “smart” search:
set ignorecase
set smartcase
C file template will be generated when you press F7 button:
map <F7> i#include <stdio.h><CR>int main(int argc, char *argv[])<CR>{<CR><CR>return 0;<CR>}<ESC>
Perl heder, when you press F8:
map <F8> i#!/usr/bin/perl -w<CR><Left><Del>use strict;<CR>use warnings;<CR>use POSIX<ESC;>
Python header, press […]

Vim + GCC

Friday, September 23rd, 2005

A friend of mine, Hussemus (Homo codigus C plus plus) asked me how to integrate gcc into Vim to compile and run applications, like in Borland’s C++.
I made a search at Vim Website (search query: gcc) and found this interesting tip. You have to add these lines in your ~/.vimrc file:
map <F5> :call CompileRunGcc()<CR>
map […]


Top Tunisie Blogs