[pene@donunix] curl -u twitter_name:twitter_password http://twitter.com/account/rate_limit_status.xml
N.B. : For information, the default rate limit is 100 requests per hour.
Welcome to Don Unix
The main purpose of this blog is to show you some interesting Unix and Linux Tips'n Tricks.
I hope you'll enjoy it
[pene@donunix] curl -u twitter_name:twitter_password http://twitter.com/account/rate_limit_status.xml
N.B. : For information, the default rate limit is 100 requests per hour.
How to display all lines with the word text or the word name?
Here is the answer:
[pene@donunix] grep -P 'text|name' file.txt
[pene@donunix] find . -maxdepth 2 -mindepth 2
The purpose of this short post is to explain how being connected to an ssh server without typing the password, how ?
With the generation of public ssh keys.
I. Client : Generation of public keys
First (just for the first time) you have to genere the 2 keys :
[donunix@client] ssh-keygen -t dsa
During the dsa key generation, ssh-keygen ask you to enter a path phrase (it replace the password system). type [enter] if you doesn't what to genere a path phrase.
The 2 keys are in the ~/.ssh directory :
[donunix@client] ls ~/.ssh/id_dsa*
id_dsa id_dsa.pub
I want to learn the french version of the Dvorak Simplified Keyboard.
To toggle my keyboard from azerty to Dvorak-bepo configuration, I need to launch the dvorak-bepo.xkb file.
So here is, how to set your keyboard in Dvorak-bepo :
[pene@donunix] xkbcomp -w0 fr-dvorak-bepo.xkb :0
And if you want to go back, with the classic French configuration :
[pene@donunix] setxkbmap fr
I've just coded this script to avoid mistakes when you're using more than one host and user login :
#!/usr/bin/ksh
#######################################
# Program : Prompt-Color
#
# Version : V1.0
# Date : 2009-03-02
# Author : N. PENE
#
# Inputs : none
#######################################
hostname=`hostname`
username=`whoami`
#-- classic colors vars :
BLACK='\[\033[0;30m\]'
RED='\[\033[0;31m\]'
GREEN='\[\033[0;32m\]'
BROWN='\[\033[0;33m\]'
BLUE='\[\033[0;34m\]'
PURPLE='\[\033[0;35m\]'
CYAN='\[\033[0;36m\]'
GRAY='\[\033[0;37m\]'
DEFAULT='\[\033[0m\]'
#-- bolded colors vars :
BBLACK='\[\033[1;30m\]'
BRED='\[\033[1;31m\]'
BGREEN='\[\033[1;32m\]'
BBROWN='\[\033[1;33m\]'
BBLUE='\[\033[1;34m\]'
BPURPLE='\[\033[1;35m\]'
BCYAN='\[\033[1;36m\]'
BGRAY='\[\033[1;37m\]'
BDEFAULT='\[\033[1;0m\]'
cprompt=$DEFAULT
cborder=$DEFAULT
cpath=$DEFAULT
#-- username color :
case $username in
"npene" ) cuser=$CYAN;;
"donunix" ) cuser=$BLUE;;
"fenice" ) cuser=$PURPLE;;
"donpene" ) cuser=$BROWN;;
"root" ) cuser=$GREEN;;
esac
#-- hostname color :
case $hostname in
"host1" ) chost=$BRED;;
"host2" ) chost=$BBLUE;;
esac
PS1="$cborder[$cuser\u$cborder@$chost\h$cborder: $cpath\W$cborder] $cprompt"
export PS1