Shaare your links…
408 links
Liens · Devenet Home Login RSS feed Tags cloud
◄ older
19 of 21
newer ►
  • Git - Le remisage → http://git-scm.com/book/fr/Utilitaires-Git-Le-remisage
    Équivalent au "shelve" de TFS (par Microsoft) : permet de stocker localement ses modifications pour retrouver un dépôt git "propre", et ainsi faire des modifications urgentes, changer de branche, bref faire autre chose, puis une fois ces choses terminées, retrouver l'état initial.
    It's awesome!
    Fri Apr 11 15:33:49 2014 – #permalink
    astuce git
  • PHP - Best Practises → http://thisinterestsme.com/php-best-practises/
    Petite liste des bonnes pratiques PHP à respecter.
    Bon, pas de grosses nouveautés (*never trust user input* oh really?).

    function calculateAge($dateOfBirth){
       $birthday = new DateTime($dateOfBirth);
       $interval = $birthday->diff(new DateTime);
       return $interval->y;
    }
    Fri Apr 11 13:33:32 2014 – #permalink
    astuce php ressource
  • LogWatch Apache / HTTP avec Virtual Host - Wiki de Romain RUDIGER → http://romain.novalan.fr/wiki/LogWatch_Apache_/_HTTP_avec_Virtual_Host
    Voici mon format de log Apache :

    LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined

    Le champ contenant le virtual host sera donc le premier.

    Il faut modifier le script du service http, on le prend donc pour ensuite le modifier :

    cp /usr/share/logwatch/scripts/services/http  /etc/logwatch/scripts/services/

    Maintenant il suffit de modifier le code suivant :

    577    if ( ($field{http_rc} >= 400) &&
    578          !((defined $ignoreURLs) && ($field{url} =~ /$ignoreURLs/)) &&
    579          !((defined $ignoreIPs) && ($field{client_ip} =~ /$ignoreIPs/)) ) {
    580       my $fmt_url = $field{url};
    581       if (length($field{url}) > 60) {
    582          $fmt_url = substr($field{url},0,42) . " ... " .
    583                     substr($field{url},-15,15);
    584       }
    585       $needs_exam{$field{http_rc}}{$fmt_url}++;
    586    }

    Pour :

    577    if ( ($field{http_rc} >= 400) &&
    578          !((defined $ignoreURLs) && ($field{url} =~ /$ignoreURLs/)) &&
    579          !((defined $ignoreIPs) && ($field{client_ip} =~ /$ignoreIPs/)) ) {
    580       my $fmt_url = $field{url};
    581       if (length($field{url}) > 60) {
    582          $fmt_url = substr($field{url},0,42) . " ... " .
    583                     substr($field{url},-15,15);
    584       }
    585       my $vhost = $field{$log_fields[0]};
    586       $vhost =~ s/\s+$//;
    587       $fmt_url =~ s/^[[:alnum:]]/\ $&/;
    588       $needs_exam{$field{http_rc}}{$vhost . $fmt_url}++;
    589    }

    Il faut également modifier le fichier de configuration du service http. On le copie :

    cp /usr/share/logwatch/default.conf/services/http.conf /etc/logwatch/conf/services/

    Modification de la variable LogFormat :

    $LogFormat = "%{v} %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
    Wed Apr 9 12:07:17 2014 – #permalink
    apache rbpi sécurité
  • Table des caractères Unicode (2000-2FFF) — Wikipédia → http://fr.wikipedia.org/wiki/Table_des_caract%C3%A8res_Unicode_(2000-2FFF)
    Tables des caractères (spéciaux) HTML pour afficher sur une page web.

    Edit : il y a aussi http://character-code.com/ !
    Mon Apr 7 23:04:20 2014 – #permalink
    html ressource
  • 7 lines JavaScript library for calling asynchronous functions → http://krasimirtsonev.com/blog/article/7-lines-JavaScript-library-for-calling-asynchronous-functions
    M'ouais sinon y'a http://stackoverflow.com/questions/899102/how-do-i-store-javascript-functions-in-a-queue-for-them-to-be-executed-eventuall

    // Function wrapping code.
    // fn - reference to function.
    // context - what you want "this" to be.
    // params - array of parameters to pass to function.
    var wrapFunction = function(fn, context, params) {
       return function() {
           fn.apply(context, params);
       };
    }


    // Create my function to be wrapped
    var sayStuff = function(str) {
       alert(str);
    }

    // Wrap the function.  Make sure that the params are an array.
    var fun1 = wrapFunction(sayStuff, this, ["Hello, world!"]);
    var fun2 = wrapFunction(sayStuff, this, ["Goodbye, cruel world!"]);

    // Create an array and append your functions to them
    var funqueue = [];
    funqueue.push(fun1);
    funqueue.push(fun2);

    // Remove and execute all items in the array
    while (funqueue.length > 0) {
       (funqueue.shift())();  
    }
    Mon Apr 7 22:29:54 2014 – #permalink
    javascript ressource
  • I can have your IP → http://icanhazip.com/
    Petit site web qui renvoie l'IP du demandeur, et uniquement l'IP sans fioriture !
    Tue Mar 25 16:51:51 2014 – #permalink
    astuce internet ip ressource
  • Tony Finch - Simple shell scripting for Twitter → http://fanf.livejournal.com/108436.html
    Simple shell scripting for Twitter

    I have a few scripts which manage my URL log, including posting a copy of the feed to my Twitter and del.icio.us accounts. Until recently the scripts have just used wget's HTTP Basic Auth support to authenticate to my accounts. This has to change because Twitter is switching to oauth. This switch has already been delayed but is now due to occur by the end of August.

    Most oauth implementations are not designed for old school languages like the Unix shell, so I procrastinated because I didn't fancy dealing with the dependency hell of mainstream scripting languages. But I perked up when I noticed Jef Poskanzer mentioning his stand-alone oauth implementation on his twitter feed. I have liked Jef's approach to writing simple code since I worked on thttpd in support of Demon's homepages service.

    Posting to Twitter with basic auth didn't require anything beyond a Twitter account. You could just POST to https://twitter.com/statuses/update.json - which is the essence of the security problem that the Twitter crew want to solve.

    To use oauth you must register an application. Go to https://dev.twitter.com/ -> Get started -> Your apps -> Register a new app. Fill in the form. Tell it the app is a client app and give it read+write permission.

    When you have done that you will be presented with your application's settings page. The interesting parts are the "consumer key" and the "consumer secret" which are the half of your app's oauth credentials which authenticate the application to Twitter. The other half of the credentials prove that your app may do something to a particular person's Twitter account. In order to obtain the second half oauth normally requires a fairly complicated dance. Happily, for simple cases where you want to script your own account, Twitter provides a shortcut.

    On your application's settings page, click the "My Access Token" link. This gives you a page containing your "access token" and "access token secret" which together with your "consumer key" and "consumer secret" allow your app to post to your Twitter account.

    Now you need some software. Fetch Jef Poskanzer's oauth_sign and http_post packages. You can use oauth_sign with wget or curl, but http_post is more convenient since both it and oauth_sign encode the query parameters for you, whereas wget and curl do not. Typing make should be enough to build oauth_sign; for http_post you probably want make SSL_DEFS="-DUSE_SSL" SSL_LIBS="-lssl -lcrypto".

    Now you have everything you need to write a simple shell twitter client. Something like:

       #!/bin/sh

       consumer_key="COPY-FROM-APP-SETTINGS-PAGE"
       consumer_secret="COPY-FROM-APP-SETTINGS-PAGE"
       access_token="COPY-FROM-MY-ACCESS-TOKEN-PAGE"
       access_secret="COPY-FROM-MY-ACCESS-TOKEN-PAGE"
       url="https://api.twitter.com/1.1/statuses/update.json";

       http_post -h Authorization "$(oauth_sign \
    $consumer_key $consumer_secret \
    $access_token $access_secret \
    POST "$url" status="$*")" \
        "$url" status="$*"

    That should be enough to get you going.

    For completeness (and since I worked out how to do it I'm going to inflict it on you) here's how to use Jef's tools to do the full three party oauth procedure.

       First obtain a request oauth token and secret. For this transaction your oauth token and secret are empty. The HTTP request is a POST with an empty body.

       http_post -h Authorization "$(oauth_sign \
           $consumer_key $consumer_secret "" "" \
           POST https://api.twitter.com/oauth/request_token)"; \
                https://api.twitter.com/oauth/request_token

       The response will contain oauth_token and oauth_token_secret parameters which are your request token and secret. You must then get your victim to visit the URL https://api.twitter.com/oauth/authorize?oauth_token=$request_token. They will be asked to give your app permission to diddle with their account. (They may have to log in first.)
       When they have done this they will be redirected to your app's callback URL, with some extra parameters. The documentation says these will be a copy of the request oauth_token and an oauth_verifier but in my testing the verifier was missing.
       If your app is a client app (which has no callback URL or the URL is "oob") then the user will be presented with a PIN which is the request verifier.
       You can now obtain the access token and secret as follows.

       http_post -h Authorization "$(oauth_sign \
           $consumer_key $consumer_secret \
           $request_token $request_secret \
           POST https://api.twitter.com/oauth/access_token oauth_verifier="$verifier")" \
                https://api.twitter.com/oauth/access_token oauth_verifier="$verifier"

       The response will contain oauth_token and oauth_token_secret parameters which are the access token and secret that you must use when your app wants to do something with your victim's account.

    I hope this might be of use to someone else...
    Tue Mar 25 16:49:40 2014 – #permalink
    rbpi shell twitter
  • OS X Mavericks: Pas à pas pour faire une installation propre (Clean Install) ou une mise à jour et tout ce qu'il faut savoir pour passer à Mavericks • Actualité Apple, Mac, iPhone, iPad, App Store avec Ohmymac → http://www.ohmymac.fr/os-x-mavericks-pas-a-pas-pour-faire-une-installation-propre-clean-install-ou-une-mise-a-jour-et-tout-ce-quil-faut-savoir-pour-passer-a-mavericks/
    Comment faire une installation propre de Mavericks : pas juste une upgrade, création d'un DVD d'installation pour “formatage”.
    Mon Nov 25 14:18:40 2013 – #permalink
    apple mac mémo ressource
  • Scarab : dictionnaire de Scrabble → http://www.kurokatta.org/hacks/scarab-fr
    Un petit site web pour trouver des anagrammes et autres joyeusetés :)
    Fri Oct 4 17:47:43 2013 – #permalink
    astuce ressource scrabble
  • Keypress: A Javascript library for capturing input → http://dmauro.github.io/Keypress/
    Une petite librairie JavaScript (apparemment sans dépendance apparament) pour écouter les touches tapées sur le clavier d'un internaute dans une page Web. Ça a l'air intéressant et très pratique, et plus c'est sur github :)
    Tue Oct 1 17:44:27 2013 – #permalink
    développement javascript ressource
  • yourTinyTodo | Simple way to manage your todo list in AJAX style → http://www.yourtinytodo.net/
    Petit utilitaire bien pratique pour gérer différentes tâches à faire.
    Sun Sep 22 02:41:53 2013 – #permalink
    gestion php ressource
  • How to make a DIY home alarm system with a raspberry pi and a webcam → https://medium.com/p/2d5a2d61da3d
    Tuto qui a l'air complet pour l'installation d'une webcam et du logiciel motion pour détecter les mouvements dans une pièce et faire de la vidéo surveillance.
    Thu Sep 19 22:15:47 2013 – #permalink
    rbpi ressource unix webcam
  • Create a icalendar/vcalendar event file online → http://www.pratie.com/lab/icalendar/
    Web application pour générer en ligne très facilement un évènement iCalendar
    Wed Sep 18 15:43:46 2013 – #permalink
    astuce event ressource web
  • Arguments Rhétologiques Fallacieux → http://www.informationisbeautiful.net/visualizations/arguments-rhetologiques-fallacieux/
    Petite liste des faux arguments...

    (via http://sebsauvage.net/links/?Rb3kDg)
    Sat Sep 14 16:25:23 2013 – #permalink
    psychologie
  • Syncing a fork → https://help.github.com/articles/syncing-a-fork
    Comment mettre à jour la branche upstream d'un fork :
    1. Vérifier que les branches d'origine sont bien présentes : git remote -v
    2. Sinon on les ajoute : git remote add upstream https://github.com/otheruser/repo.git
    3. On met à jour les branches d'origine : git fetch upstream
    4. On sélectionne la branche locale : git checkout master
    5. On peut merger : git merge upstream/master
    Sun Sep 8 19:38:20 2013 – #permalink
    développement git mémo ressource
  • Linux: Kill multiple processes with one single command → http://www.oracleflash.com/20/How-to-kill-all-processes-with-one-command-in-Linux.html
    Comment supprimer tous les processus ayant un nom de commande commun :
    kill -9 `ps -ef | grep NOM_COMMANDE | grep -v grep | awk '{print $2}'`

    Note : nettoyer/purger les fichiers logs
    1. les afficher par taille : du /var/logs -akhx  | sort -nr
    2. pruger les plus gros : cat /dev/null > /var/logs/kernel.log
    Sun Sep 8 14:20:12 2013 – #permalink
    astuce rbpi ressource shell unix
  • Apt : gestion facile des paquets sous Debian → http://grawok.wordpress.com/2012/02/12/apt-gestion-facile-des-paquets-sous-debian/
    Rappel des principales fonctions pour gérer les paquets sous debian, tels que apt-get update, etc
    Sat Sep 7 23:21:21 2013 – #permalink
    astuce mémo rbpi ressource unix
  • Unix : Le Korn Shell → http://www.shellunix.com/ksh.html
    Mémo de quelques syntaxes du Shell
    Sat Sep 7 17:35:02 2013 – #permalink
    développement mémo ressource shell unix
  • Comment transformer votre Raspberry Pi en serveur webcam ? → http://www.epingle.info/?p=2682
    Liste de quelques utilitaires pour utiliser sa webcam en mode capture d'image ou vidéo.

    Autres articles intéressants :
    - Guide pratique des webcams http://www.tldp.org/pub/Linux/docs/HOWTO/translations/fr/html-1page/Webcam-HOWTO.html#framegrabbers
    - Enregistrer un flux vidéo avec une webcam http://coagul.org/drupal/publication/enregistrer-flux-vid%C3%A9o-webcam

    Ajout du 8/4/2014 :
    - Time-lapse Setup Using a USB webcam : http://www.raspberrypi.org/learning/webcam-timelapse-setup/
    - Using a standard USB webcam : https://github.com/raspberrypi/documentation/blob/master/usage/webcams.md
    Thu Sep 5 00:44:54 2013 – #permalink
    rbpi ressource webcam
  • Gestion sémantique de version → http://semver.org/lang/fr/
    Comment gérer ses numéros de version.
    Tue Sep 3 18:14:05 2013 – #permalink
    développement git ressource
◄ older
19 of 21
newer ►
Shaarli by sebsauvage
Shaarli-Theme by Nicolas based on idleman theme