Chronosbox

Backing to activities

by Felipe 'chronos' Prenholato on Friday, 03 July/2009, under My Blog

After a while without touching the blog (I had good reasons), has returned the activities …
Twitter: http://twitter.com/chronossc

Leave a Comment

Wombat vim colorscheme – customized

by Felipe 'chronos' Prenholato on Friday, 03 July/2009, under Colorscheme, Tips, VIM - Vi IMproveded

Searching for cool python related plugins for VIM I found (tripped) in a theme called Wombat, a variation of Desert theme created by Lars H. Nielsen. So, I get it, and worked a bit on, making some changes to made it a bit more dark, like I did on my custom desert theme.

Here is a 1440×900 screenshot with two gvim opened with original wombat and my modified wombat theme:

original wombat theme with my custom wombat theme

original wombat theme with my custom wombat theme

With more vivid colors I think that is better to read on night, with no light (how I normally code when my room colleague sleep). This week I code a lot on my timetracker project (soon I post something about here) and my girlfriend’s blog, and talk how this theme looks for coding.

Download: Download: wombat modified colorscheme

Enjoy!

7 Comments :, , ,

My Blog optimizations

by Felipe 'chronos' Prenholato on Friday, 03 July/2009, under My Blog

Hello my dear readers (I hove that already exist someone :])

Today I decided to put some optimizations in Wordpress, and I’m really impressed! The big optimization are adition of WP-Super-Cache plugin. After actived I get a load diference from 10 seconds to 3 seconds using Mozilla Firefox on Linux. Really a big optimization.

Also, I actived follow plugins:

With these plugins my plans are follow blog evolution and access.

Let’s see results in some days.

2 Comments :, ,

VIM desert theme customized.

by Felipe 'chronos' Prenholato on Friday, 03 July/2009, under VIM - Vi IMproveded

Hello! In first article of ‘new’ blog with new design, I show for you the cause of this initial move.

I make some modifications in desert vim theme and now he is very confortable to work on my long nights at weekends (when I not with my girlfriend).

Below, I show two screenshots, one with each theme to compare.

desert custom theme

desert custom theme

desert theme

desert theme

To use save file mytheme.vim under your color directorie (vim root or .vim at your home).

Greetings :)

1 Comment :, ,

Finalmente os mockups do site !

by Felipe 'chronos' Prenholato on Friday, 03 July/2009, under My Blog

Eis que finalmente mostro-lhe minha ‘obra prima’, all by inkscape!
Seguem abaixo os desenhos iniciais a partir de onde farei meu o layout inteiro do meu blog :]
(continue reading…)

2 Comments

Automatic reindent your files with VIM

by Felipe 'chronos' Prenholato on Friday, 03 July/2009, under Planet GentooBR, Tips, VIM - Vi IMproveded

Hey people

After a long time without post on blog, but always colecting ideas, the tip of today touch in a delicated area, code indent. Around all word we found ugly and mall indented codes (except in python :]), and, when working with PHP, this is a case extremely normal and really sucks.

So, one day, I start to search for a batch mode for vim, because for me, reident of PHP files with vim is awesome!. My idea is a single script that launchy vim in batch mode for each file, reindent and save.

Very well, after about 30 minutes of talk in #vim da irc.freenode.net, some people talk about ‘-c’ option, that, for some reason, I not see on vim man pages :\. Now let’s tip!
(continue reading…)

5 Comments :, ,

Matando sessões de outros usuários em servidores *nix, mas só como root.

by Felipe 'chronos' Prenholato on Friday, 03 July/2009, under Linux

Bem, certo dia da minha vida, tive que kickar um sysadmin do servidor dele, onde eu
estava instalando um portal pq ele realmente estava me atrapalhando, ficava reiniciando postgresql toda hora, o servidor também … enfim, ridículo :D .

Me bateu uma luz (por causa do mesmo sysadmin) hoje e fiz uma coisa legal, segue
abaixo um script para kickar todos os usuários que não seja o que vc passar ou
kickar o que vc passar, pegando principalmente por IP/Maquina deles.

Naturalmente você só poderá rodar o script como root, mas acredite, não é difícil conseguir.
A maioria dos servidores acaba dando uma permissão com sudo a algum arquivo usando vim, tipo, sudo vim /etc/apache/vhosts/seuvhost.conf, dentro do vim, execute :!su - e você terá um shell como root.
(continue reading…)

5 Comments :, , , ,

pingping – Checking if servers is on.

by Felipe 'chronos' Prenholato on Friday, 03 July/2009, under Linux, Planet GentooBR, Servers, Tips

Above is my pingping script. This script send a mail alert when some server stop, based on regular ICMP requests. Read it!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/sh
# This script send ICMP requests for each server on SERVIDORES list and sends
# emails for emails in LISTA_EMAILS list why one of servers doesn't reply
# You only receive alerts if in last time that script request server we have a success reply
# or if we not tested server yet.
#
# Author: Felipe Rafael Prenholato - chronos@gentoobr.org
# IRC: nick chronos at irc.freenode.net
# Date: 21 de Junho de 2006.
#
# This script is under GPLv2. Read it at http://www.gnu.org/licenses/gpl-2.0.txt.
# Any changes please send me a mail :).
#
 
# IP or name of servers to test
SERVIDORES="elise prime odissey"
 
# emailo to send alerts
LISTA_EMAILS="chronos@gentoobr.org philipe_rp@yahoo.com.br"
 
# date format to send in email
data=$(date +"%T de %d/%m/%Y")
 
# this function sends ping
ping_server() {
 
local pingreturn
local serversts
local TMPFILE
local server
 
server=$1
TMPFILE="/tmp/ping_$server.tmp"
 
# Debug
#echo "Server: $server"
#echo "Temp file: $TMPFILE"
 
# ping and get return
ping -c3 $server &>/dev/null;
pingreturn=$?;
 
# 0 means ok
if [ "$pingreturn" == "0" ]
then
echo "1" > $TMPFILE
fi
 
# 1 means problems
if [ "$pingreturn" == "1" ]
then
 
if ! [ -e $TMPFILE ]
then
echo "1" > $TMPFILE
fi
 
serversts=$(cat $TMPFILE)
 
# send mail if have problems
if [ "$serversts" == "1" ]
then
 
echo "0" > $TMPFILE
msg="Servidor $server fora do ar em $data. Contatar responsavéis."
ass="Servidor $server fora do ar."
LC_ALL="en_US.ISO-8859-1" echo "$msg" | mail -s "$ass" $LISTA_EMAILS
fi
 
fi
 
}
 
# roda ping_server para cada servidor.
for e in $(echo $SERVIDORES);
do
ping_server $e;
done

Install this script in one server that can send ICMP requests to servers in lists. Very old versions of postfix doesn’t works because this script needs -a option in mail command. Use as:

./script

Run in cron and have peace :D

1 Comment :, , , , ,

Archives

StatPress

Visits today: 22 Visits since 6 de April de 2009: 1098 Visitors now: %visitoronline%