Skip to content

Instantly share code, notes, and snippets.

António P. P. Almeida perusio

  • Perusio LLC & UP42
  • Berlin, Germany
Block or report user

Report or block perusio

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
perusio / hook-views-api-skel.el
Created Jan 1, 2011
A Emacs Lisp skeleton for inserting a hook_views_api
View hook-views-api-skel.el
(define-skeleton hook-views-api-skel
"Inserts a hook_views_api template in the current buffer."
> "/**" \n
> -2 "* Implementation of hook_views_api().\n"
> "*/" \n
> "function " (setq v1 (skeleton-read "Module name: ")) "_views_api() {" \n
> "return array(" \n
> "'api' => " (setq v2 (skeleton-read "API version: ")) | "2" "," \n
> "'path' => drupal_get_path('module', '" v1 "') . " (setq v2 (skeleton-read "Path: ")) | "'/includes/views'" "," \n
perusio / gist:1034475
Created Jun 19, 2011
How to prevent accidental iconification in Emacs
View gist:1034475
;;; This is taken from planet Emacsen:
;;; I've added a check to see if we're on a graphic environment.
;;; Prevent acidental iconify/suspend.
(when (window-system)
(defun smart-iconify-or-deiconify-frame ()
"Present a confirmation before suspending/iconifying."
(if (yes-or-no-p (format "Are you sure you want to iconify/deiconify Emacs? "))
perusio / local-kernel
Created Jun 20, 2011
Logcheck ignore rules for synaptics touchpad synchronization issues
View local-kernel
kernel: \[[[:digit:]]+\.[[:digit:]]+\] psmouse\.c: TouchPad at isa[[:digit:]]+/serio[[:digit:]]/input[[:digit:]] lost sync.*
kernel: \[[[:digit:]]+\.[[:digit:]]+\] psmouse\.c: issuing reconnect request
kernel: \[[[:digit:]]+\.[[:digit:]]+\] psmouse\.c: TouchPad at isa[[:digit:]]+/serio[[:digit:]]/input[[:digit:]] - driver resynched
perusio / gist:1043907
Created Jun 23, 2011
How to whitelist file extensions in Nginx
View gist:1043907
## This should be the first location in yout config.
location ~* \.(?:gif|html|jpe?g|png|ico|js|css|flv|swf|pdf|xml)$ {
# serve static files
# Put all other locations below
location / {
(...) # more stuff
perusio / gist:1071894
Created Jul 8, 2011
How to have your files always tidy: no trailing spaces, no tabs and properly indented on emacs
View gist:1071894
;;; Clean up the current buffer: indent it, remove tabs and delete the
;;; trailing whitespace.
(defun tidy-up-buffer ()
" Do a cleanup of the current buffer: tabs, spaces and indent
perusio / gist:1087950
Created Jul 17, 2011
Adding ronn to the emacs auto-mode-alist for enabling markdown-mode as the major-mode
View gist:1087950
;;; This is to enable ronn files to be treated as markdown files.
(add-to-list 'auto-mode-alist '("\\.ronn$" . markdown-mode))
perusio / gist:1154002
Created Aug 18, 2011
My ~/.config/lxterminal/lxterminal.conf with solarized colors
View gist:1154002
fontname=Terminus 9
perusio /
Created Aug 20, 2011
Apache Killer by KingCope exploits mod_deflate vulnerability
#Apache httpd Remote Denial of Service (memory exhaustion)
#By Kingcope
#Year 2011
# Will result in swapping memory to filesystem on the remote side
# plus killing of processes when running out of swap space.
# Remote System becomes unstable.
use IO::Socket;
perusio / gist:1259095
Created Oct 3, 2011
SSL configuration for fixing BEAST SSL vulnerability
View gist:1259095
## BEAST SSL vuln server side workaround.
## This will break IE6 and below SSL handling. Works in all other browsers. Grabbed from:
ssl_ciphers RC4:HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
perusio / gist:1290446
Created Oct 16, 2011
Example microcache configuration
View gist:1290446
## Declare cache zone.
fastcgi_cache_path /opt/local/var/cache/nginx levels=1:2 keys_zone=microcache:5m max_size=1G;
map $http_cookie $no_cache {
default 0;
~_mcnc 1;
server {
You can’t perform that action at this time.