Todos con Software Libre

El Software y el conocimiento debe ser Libre

Follow me on TwitterRSS Feeds

  • Home
  • Camino de Santiago
  • Corazón de La Mancha
  • Manchegox
  • Mobile Me
  • Parámetro del kernel Linux - file-max

    Parámetro del kernel de Linux - file-max. El kernel de Linux asigna los identificadores de archivos de forma dinámica y el valor de file-max denota el número máximo de manejadores de archivos que el kernel de Linux puede asignar. Cuando aparece muchos mensajes de error sobre la "escasez de controladores de archivos", el aumento de este límite será de ayuda. Para cambiar, el valor, simplemente escribimos el nuevo núm...
    More
  • WebOS se pasa al OpenSource

    Os dejo el mensaje que Fred Patton ha publicado en su blog: Editor’s note: Today’s blog post comes from Sam Greenblatt, the chief technology officer and head of technical strategy for the open webOS project. He guides the project’s strategy around open collaboration and is responsible for technical engineering. His focus is on the practice of developing webOS with the community, and his approach is founded on the be...
    More
  • Richard Stallman de retiro temporal o descanso vacacional

    Pues parece ser que Richard Stallman se ha tomado un respiro, aunque el no desconecta nunca y tarde o temprano contesta a nuestros correos. Recientemente le escribí y esta es la respuesta: I am not on vacation, but I am at the end of a long time delay. I am located somewhere on Earth, but as far as responding to email is concerned, I appear to be well outside the solar system. After your message arrives ...
    More
  • Steve Jobs finalmente utiliza un tablet con Android en la otra vida

    Lo admito, los ataques contra Apple, a veces son divertidos. Como podemos ver en este vídeo, en el que imitan a Steve Jobs, en la otra vida, con un tablet con Android. Esto lo hacen como video viral para promocionar dicho tablet.
    More
  • libvirt Perl binding Sys::Virt, release 0.9.9

    The libvirt Perl binding, Sys::Virt, release 0.9.9 is now available for download: http://search.cpan.org/CPAN/authors/id/D/DA/DANBERR/Sys-Virt-0.9.9.tar.gz In this release 0.9.9: Add all new APIs in libvirt 0.9.9 Fix crash in get_hostname Fix docs typos & nesting screwups Add example for calculating CPU utilization of host Update META.yml with correct license info Add missing dep on ...
    More

CentOS 6.1

Dec 12th

Posted by javico in CentOS

No comments

Ya salió la nueva versión de CentOS 6.1. Aquí tenéis las notas de la versión.

Como siempre se recomienda la descarga vía torrent:
Versión 32 y 64 bits:

http://mirror.centos.org/centos/6.1/isos/i386/CentOS-6.1-i386-bin-DVD1to2.torrent
http://mirror.centos.org/centos/6.1/isos/x86_64/CentOS-6.1-x86_64-bin-DVD1to2.torrent


Se han demorado bastante, pero han consolidado varios de los productos de Red Hat Enterprise Linux que ahora están sacando de manera independiente, en un sólo instalador.

Indican que posiblemente que las siguientes versiones saldrán más rápido, porque al parecer ya han tomado idea de cómo RedHat está publicando sus productos.

Ya están trabajando en la versión 6.2 de Red Hat Enterprise, que salió recientemente, para sacar lo antes posible la próxima versión de CentOS 6.2.

Hay un nuevo concepto que es lo que llaman cr (continuos release) que son los paquetes de las siguientes versiones, que los ponen en CR para que puedas ir actualizando sin esperar a que salga el nuevo ISO. Mas información sobre CR aquí.

 

Tambien esta disponible la version 32 bits y 64 bits del LiveCD de CentOS 6.1.

http://wiki.centos.org/Manuals/ReleaseNotes/CentOSLiveCD6.1
http://mirror.centos.org/centos/6/isos/x86_64/CentOS-6.1-x86_64-LiveDVD.torrent

http://mirror.centos.org/centos/6/isos/i386/CentOS-6.1-i386-LiveDVD.torrent
CentOS

Nueva versión de Libvirt 0.9.8

Dec 9th

Posted by javico in KVM

No comments

Un mes después, exactamente, de la salida de la versión anterior, la versión 0.9.8 esta disponible en
ftp://libvirt.org/libvirt/

Esta versión es una mezcla de nuevas mejoras, correcciones y nuevas características:


Features:
- Add support for QEMU 1.0 (Jiri Denemark)
- Add PPC cpu driver. (Prerna Saxena)
- Add new API virDomain{Set, Get}BlockIoTune (Lei Li)
- block_resize: Define the new API (Osier Yang)
- Add a public API to invoke suspend/resume on the host (Srivatsa S. Bhat)
- various improvements for LXC containers (Daniel P. Berrange)
- Define keepalive protocol and add virConnectIsAlive API (Jiri Denemark)
- Add support for STP filtering (Stefan Berger)
- Add support for VLAN filtering (Stefan Berger)

Documentation:
- Add documentation for <disk><source type=”dir”> (Christophe Fergeau)
- Fix typo in virDomainResume API doc (Christophe Fergeau)
- maint: fix improper use of ‘an’ (Eric Blake)
- virsh: translate net-info help (Eric Blake)
- maint: typo fixes (Eric Blake)
- virsh: Fix typos in man page (Jiri Denemark)
- rpc: Fix a typo in virNetClientSendNonBlock documentation (Jiri Denemark)
- docs: fix grammar of capabilities (Eric Blake)
- Documentation about chains’ priorities, lists of elements etc. (Stefan Berger)

Portability:
- spec: don’t use chkconfig –list (Eric Blake)
- build: fix build with older libxml2 (Eric Blake)
- Conditionalize daemonPath decl for Win32 which lacks UNIX sockets (Daniel P. Berrange)
- build: reduce warnings from older gcc (Eric Blake)
- Fix incorrect symbols for virtime.h module breaking Mingw32 (Daniel P. Berrange)
- build: fix build on Cygwin (Eric Blake)
- build: fix build at -O2 on rawhide (Eric Blake)
- Fix build for platforms lacking struct ifreq (Daniel P. Berrange)
- build: fix ‘make dist’ without dtrace (Eric Blake)
- Don’t use undocumented __isleap macro (Daniel P. Berrange)
- virnetsocket: pass XAUTORITY for ssh connection (Christian Franke)
- Fix build on Mingw32 wrt export of virNetServerGetDBusConn (Daniel P. Berrange)
- build: fix compile error with no macvtap (Eric Blake)
- Fix build with polkit0 (Jim Fehlig)
- Fix strchr call triggering gcc 4.3 & 4.4 bug (Stefan Berger)
- PATCH: Fix build without MACVTAP (Michael Wood)
- util: fix compile error on debian (Eli Qiao)
- Disable numactl on ARM architectures too (Daniel P. Berrange)
- Add libvirt confdir to files section in mingw32 spec (Daniel P. Berrange)
- build: fix mingw build of gnulib openpty (Eric Blake)

Bug Fixes:
- Fix updating of haveTheBuck in RPC client to be race-free (Daniel P. Berrange)
- Prevent crash of libvirtd when attaching to existing qemu process (Jim Fehlig)
- qemu: Ignore shutdown event from destroyed domain (Jiri Denemark)
- remote_driver: don’t fail if keepalive check fails (Guido Günther)
- command: handle empty buffer argument correctly (Eric Blake)
- client: Check if other thread claims it has the buck before claiming it. (Peter Krempa)
- Avoid crash in shunloadtest (Daniel P. Berrange)
- Fix a logic error for setting block I/O (Lei Li)
- virsh: Allow other escape characters for console (Michal Privoznik)
- bridge_driver: Don’t define network if XML contains more IPv4 adreses. (Peter Krempa)
- virsh: Fix possible deadlock when virsh is about to exit (Jiri Denemark)
- util: Plug memory leak on virNetDevMacVLanCreateWithVPortProfile() error path (Alex Jia)
- util: Plug memory leak on virNetDevBridgeGet() sucessful path (Alex Jia)
- uml: Plug memory leak on umlStartVMDaemon() error path (Alex Jia)
- rpc: Plug memory leak on virNetClientSendInternal() error path (Alex Jia)
- conf: Plug memory leak on virDomainDefParseXML() error path (Alex Jia)
- qemu: Plug memory leak onqemuProcessWaitForMonitor() error path (Alex Jia)
- conf: reject duplicate paths in device weights (Eric Blake)
- Make logging async signal safe wrt time stamp generation (Daniel P. Berrange)
- Don’t mark suspend as active until we know it is running (Daniel P. Berrange)
- util: avoid null deref on qcowXGetBackingStore (Alex Jia)
- virsh: correct return value error (Alex Jia)
- qemu: fix blkiotune –live –config (Eric Blake)
- lxc: Fix suspend/resume with freezer cgroup (Jiri Denemark)
- rpc: Really send non-blocking calls while waiting for another call (Jiri Denemark)
- util: fix thinko in runIO (Paolo Bonzini)
- storage: Skip socket and fifo on pool-start (Michal Privoznik)
- conf: Don’t drop console definition on domain restart (Michal Privoznik)
- qemu: Avoid dereference of NULL pointer (Peter Krempa)
- nwfilter: Initialize virNWFilterAddIpAddrForIfname return variable (Michal Privoznik)
- Fix disabling of virtual port profile code on old hosts (Daniel P. Berrange)
- Fix uninitialized variable in NWfilter IP learning code (Daniel P. Berrange)
- storage: Fallback to use lvchange first if lvremove fails (Chang Liu)
- conf: don’t modify cpu set string during parsing (Eric Blake)
- qemu: don’t release network actual device twice (Roopa Prabhu)
- tests: avoid xend ABRT crash report (Eric Blake)
- Fix use of uninitialized variable in QEMU driver (Daniel P. Berrange)
- snapshot: refuse to generate names for non-regular backing files (Eric Blake)
- fix a bug in remoteSerializeTypedParameters (Hu Tao)
- Don’t return a fatal error if receiving unexpected stream data (Daniel P. Berrange)
- Fix handling of stream EOF (Daniel P. Berrange)
- storage: forbid rebuilding existing disk storage pools (Guido Günther)
- qemu: fix domjobabort regression (Eric Blake)
- fix two bugs in bridge_driver.c (Hu Tao)
- nwfilter: avoid failure with noexec /tmp (Eric Blake)
- lxc: free error object to avoid memory leak (Alex Jia)
- lxc: free ‘ttyFDs’ array on return from lxcVmStart (Alex Jia)

Improvements:
- npiv: Expose fabric_name outside (Osier Yang)
- Improve error reporting when libvirtd is not installed (Daniel P. Berrange)
- spec: fix sanlock dependency (Eric Blake)
- spec: add dmidecode as prereq (Eric Blake)
- examples: Update event tests for shutdown event (Jiri Denemark)
- qemu: Rework handling of shutdown event (Jiri Denemark)
- python: Expose binding for virNodeGetMemoryStats() (Peter Krempa)
- python: Expose binding for virNodeGetCPUStats() (Peter Krempa)
- build: require more tools from maintainers (Eric Blake)
- apparmor: allow tunnelled migrations. (Serge Hallyn)
- Update of filters to handle multiple IP addresses (Stefan Berger)
- build: update to latest gnulib (Eric Blake)
- build: properly skip tests (Eric Blake)
- spec: mark directories in /var/run as ghosts (Eric Blake)
- qemu: filter blkio 0-device-weight at two other places (Hu Tao)
- qemu: amend existing table of device weights (Eric Blake)
- virsh: fix setting weight and device-weights at the same time (Hu Tao)
- Add tests for blkdeviotune (Lei Li)
- Support virDomain{Set, Get}BlockIoTune in the python API (Lei Li)
- Enable the blkdeviotune command in virsh (Lei Li)
- Implement virDomain{Set, Get}BlockIoTune for the qemu driver (Lei Li)
- Support block I/O throttle in XML (Lei Li)
- Add virDomain{Set, Get}BlockIoTune support to the remote driver (Lei Li)
- Fix leak build config file path (Daniel P. Berrange)
- Add internal APIs for dealing with time (Daniel P. Berrange)
- Remove obsolete virGetPMCapabilities sym from private symbols file (Daniel P. Berrange)
- Add suspend info to Xen, LXC and UML hypervisor capabilities (Daniel P. Berrange)
- Remove pointless strdup in node suspend code (Daniel P. Berrange)
- Do lazy init of host PM features (Daniel P. Berrange)
- Remove powerMgmt_valid field from capabilities struct (Daniel P. Berrange)
- Add export of node suspend capabilities APIs (Daniel P. Berrange)
- Move suspend capabilities APIs out of util.h into virnodesuspend.c (Daniel P. Berrange)
- Rename suspend capabilities APIs (Daniel P. Berrange)
- Sanitize virDiscoverHostPMFeature to return a boolean (Daniel P. Berrange)
- Move the virHostPMCapability enum helpers into capabilities.c (Daniel P. Berrange)
- Fix capabilities XML to use generic terms for suspend targets (Daniel P. Berrange)
- Remove internal only virHostPMCapability enum (Daniel P. Berrange)
- Fix values of PM target type constants (Daniel P. Berrange)
- blkiotune: add qemu support for blkiotune.device_weight (Hu Tao)
- blkiotune: add interface for blkiotune.device_weight (Hu Tao)
- qemu, lxc: drop redundant checks (Eric Blake)
- API: prevent query of –live and –config at once (Eric Blake)
- build: fix typo in last patch (Eric Blake)
- block_resize: Update test file for RPC (Osier Yang)
- block_resize: Expose the new API to virsh (Osier Yang)
- block_resize: Implement qemu driver method (Osier Yang)
- block_resize: Implement qemu monitor functions (Osier Yang)
- block_resize: Wire up the remote protocol (Osier Yang)
- examples: Correct the example command to use testnode.xml (Osier Yang)
- Add virsh command to initiate suspend on the host (Srivatsa S. Bhat)
- Implement the core API to suspend/resume the host (Srivatsa S. Bhat)
- Add the remote protocol implementation for virNodeSuspendForDuration (Srivatsa S. Bhat)
- Add ‘Hybrid-Suspend’ power management discovery for the host (Srivatsa S. Bhat)
- virsh: Don’t traverse childless nodes in vshNodeIsSuperset (Michal Privoznik)
- conf: make virt-xml-validate work with vbox domains (Lorin Hochstein)
- conf: Improve incorrect root element error messages (Michal Privoznik)
- Refactor initial LXC mem tune / device ACL code (Daniel P. Berrange)
- Add support for blkio tuning of LXC containers (Daniel P. Berrange)
- Add support for CPU quota/period to LXC driver (Daniel P. Berrange)
- Support CPU placement in LXC driver (Daniel P. Berrange)
- Support NUMA memory placement for LXC containers (Daniel P. Berrange)
- storage: Refetch file status after open (Michal Privoznik)
- Fix version numbers for isAlive and setKeepAlive driver APIs (Jiri Denemark)
- build: Properly generate and check virkeepaliveprotocol-structs (Jiri Denemark)
- examples: Use virConnectOpenAuth in events-c (Jiri Denemark)
- qemu: Cancel p2p migration when connection breaks (Jiri Denemark)
- qemu: Add support for keepalive messages during p2p migration (Jiri Denemark)
- Add keepalive support into domain-events examples (Jiri Denemark)
- Implement virConnectIsAlive in all drivers (Jiri Denemark)
- Introduce virConnectIsAlive API (Jiri Denemark)
- Implement keepalive protocol in remote driver (Jiri Denemark)
- Add support for async close of client RPC socket (Jiri Denemark)
- Implement keepalive protocol in libvirt daemon (Jiri Denemark)
- virsh: Always run event loop (Jiri Denemark)
- Introduce virConnectSetKeepAlive (Jiri Denemark)
- Implement common keepalive handling (Jiri Denemark)
- rpc: Add some debug messages to virNetClient (Jiri Denemark)
- rpc: Fix handling of non-blocking calls that could not be sent (Jiri Denemark)
- rpc: Pass the buck only to the first available thread (Jiri Denemark)
- nwfilter: remove virConnectPtr from internal API calls (Stefan Berger)
- API: prefer ‘disk’ over ‘block’ or ‘path’ (Eric Blake)
- blockstats: support lookup by path in blockstats (Eric Blake)
- virsh: Increase device-detach intelligence (Michal Prívozník)
- Enable detection of multiple IP addresses (Stefan Berger)
- fix error message when using wrong URI alias (Eli Qiao)
- Pass additional parameter into applyDHCPOnly function (Stefan Berger)
- nwfilter: use shell variable to invoke ‘ip(6)tables’ command (Stefan Berger)
- nwfilter: use shell variable to invoke ‘ebtables’ command (Stefan Berger)
- Improve error reporting of failures to apply filtering rules (Stefan Berger)
- Add documentation for STP filtering support (Stefan Berger)
- Add test cases for STP traffic filtering (Stefan Berger)
- Add a ‘mac’ chain (Stefan Berger)
- Add strings.h include to capabilities.h for ffs() function prototype (Daniel P. Berrange)
- build: Update AUTHORS (Osier Yang)
- Export KVM Host Power Management capabilities (Srivatsa S. Bhat)
- qemu: Copy console definition from serial (Michal Privoznik)
- storage: Skips backingStore of virtual snapshot lv (Osier Yang)
- Add documentation for VLAN filtering support (Stefan Berger)
- Add test cases for VLAN traffic filtering (Stefan Berger)
- Don’t copy sexpr node value that is an empty string (Jim Fehlig)
- enable cgroup cpuset by default (Hu Tao)
- tests: test recent hash addition (Eric Blake)
- Add test cases for parsing of list values (Stefan Berger)
- Extend NWFilter parameter parser to cope with lists of values (Stefan Berger)
- Create rules for each member of a list (Stefan Berger)
- Rework value part of name-value pairs (Stefan Berger)
- Add test cases (Stefan Berger)
- Interleave jumping into chains with filtering rules in ‘root’ table (Stefan Berger)
- Extend rule priorities into negative numbers (Stefan Berger)
- Enable chains with names having a known prefix (Stefan Berger)
- Extend the filter XML to support priorities of chains (Stefan Berger)
- Use the actual names of chains in data structure (Stefan Berger)
- Use scripting for cleaning and renaming of chains (Stefan Berger)
- Make filter creation in root table more flexible (Stefan Berger)
- Introduce an internal priority for chains (Stefan Berger)
- Add function to get hash table’s key/value pairs (Stefan Berger)
- Add support for systemd init service (Daniel P. Berrange)
- Add support for interfaces with type=direct to LXC (Daniel P. Berrange)
- Allow creation of plain macvlan devices (Daniel P. Berrange)
- Refactor LXC network setup to allow future enhancements (Daniel P. Berrange)
- Add missing ‘const’ annotations for internal domain conf helpers (Daniel P. Berrange)
- qemu: Generate -numa option (Bharata B Rao)
- XML definitions for guest NUMA and parsing routines (Bharata B Rao)
- virsh: add iface-bridge and iface-unbridge commands (Laine Stump)
- Allow non-blocking message sending on virNetClient (Daniel P. Berrange)
- Refactor code for enabling/disabling I/O callback in remote client (Daniel P. Berrange)
- Split virNetClientSend into 2 methods (Daniel P. Berrange)
- Refactor code for passing the buck in the remote client (Daniel P. Berrange)
- Explicitly track whether the buck is held in remote client (Daniel P. Berrange)
- Remove all linked list handling from remote client event loop (Daniel P. Berrange)
- util: Add netdev helper functions to private symbols (Eli Qiao)
- qemu/rbd: improve rbd device specification (Sage Weil)
- maint: fix build (Stefan Berger)
- Fix error reporting in port profile parsing/formatting APIs (Daniel P. Berrange)
- API: add trivial qemu support for VIR_TYPED_PARAM_STRING (Eric Blake)
- API: remote support for VIR_TYPED_PARAM_STRING (Eric Blake)
- API: add VIR_TYPED_PARAM_STRING (Eric Blake)
- maint: use mailmap, not AUTHORS, for secondary addresses (Eric Blake)
- maint: fix make syntax-check (Stefan Berger)
- nwfilter: simplify execution of ebiptables scripts (Eric Blake)
- Remove usage of brctl command line tool (Daniel P. Berrange)
- Add an API for retrieving the MAC address of an interface (Daniel P. Berrange)
- Expose MTU management APIs (Daniel P. Berrange)
- Turn two int parameters into bools in bridge APIs (Daniel P. Berrange)
- Make all brXXX APIs raise errors, instead of returning errnos (Daniel P. Berrange)
- build: allow for local gnulib diffs (Eric Blake)
- qemu: Fix improper error message for disk detaching (Osier Yang)
- virsh: Add VSH_OFLAG_EMPTY_OK for attach-disk command (Xu He Jie)

Cleanups:
- Remove time APIs from src/util/util.h (Daniel P. Berrange)
- bandwidth: Fix funky identation (Michal Privoznik)
- qemu: fix a const-correctness issue (Eric Blake)
- build: fix accidental POTFILES.in regression (Eric Blake)
- Fix up ordering of private symbols file (Daniel P. Berrange)
- Move ifaceMacvtapLinkDump and ifaceGetNthParent functions (Daniel P. Berrange)
- Move functions for dealing with physical/virtual devices (Daniel P. Berrange)
- Rename APIs for dealing with virtual/physical functions (Daniel P. Berrange)
- Move virNetDevValidateConfig to virnetdev.c (Daniel P. Berrange)
- Rename ifaceCheck to virNetDevValidateConfig (Daniel P. Berrange)
- Move virNetDevGetIPv4Address to virnetdev.c (Daniel P. Berrange)
- Rename ifaceGetIPAddress to virNetDevGetIPv4Address (Daniel P. Berrange)
- Move virNetDevGetIndex & virNetDevGetVLanID to virnetdev.c (Daniel P. Berrange)
- Rename ifaceGetIndex and ifaceGetVLAN (Daniel P. Berrange)
- Move MAC address replacement functions to virnetdev.c (Daniel P. Berrange)
- Rename interface MAC address replacement APIs (Daniel P. Berrange)
- Move the low level macvlan creation APIs (Daniel P. Berrange)
- Rename low level macvlan creation APIs (Daniel P. Berrange)
- Rename high level macvlan creation APIs (Daniel P. Berrange)
- Rename and split the macvtap.c file (Daniel P. Berrange)
- Rename Macvtap management APIs (Daniel P. Berrange)
- Remove ifaceSetMac and ifaceGetMac APIs (Daniel P. Berrange)
- Remove ifaceUp, ifaceDown, ifaceCtrl & ifaceIsUp APIs (Daniel P. Berrange)
- Move LXC veth.c code into shared utility APIs (Daniel P. Berrange)
- Rename the LXC veth management APIs and delete duplicated APIs (Daniel P. Berrange)
- Split src/util/network.{c,h} into 5 pieces (Daniel P. Berrange)
- Rename virVirtualPortProfileParams & APIs (Daniel P. Berrange)
- build: drop useless dirent.h includes (Eric Blake)
- xenapi: remove unused variable (Eric Blake)
- Remove code instantiating filters on direct interfaces (Stefan Berger)
- Adjust naming of network device bandwidth management APIs (Daniel P. Berrange)
- Santize naming of socket address APIs (Daniel P. Berrange)
- Split bridge.h into three separate files (Daniel P. Berrange)
- Rename all brXXXX APIs to follow new convention (Daniel P. Berrange)
- Remove ‘brControl’ object (Daniel P. Berrange)

KVM, Software Libre

shell script – Baccarat game

Dec 1st

Posted by javico in Comandos

No comments

Para el que se quiera entretener en mejorar el script del juego de Baccarat, aquí lo tenéis.


#!/bin/sh

# Baccarat game, shell script written

function initializeDeck
{
    card=1
    while [ $card -lt 53 ]
    do
      deck[$card]=$card
      card=$(( $card + 1 ))
    done
    player[1]=-1; player[2]=-1; player[3]=-1; player[4]=-1; player[5]=-1
    banker[1]=-1; banker[2]=-1; banker[3]=-1; banker[4]=-1; banker[5]=-1
}

function pickCard
{
    local errcount randomcard

    threshold=10		# max guesses for a card before we fall through
    errcount=0

    while [ $errcount -lt $threshold ]
    do
      randomcard=$(( ( $RANDOM % 52 ) + 1 ))
      errcount=$(( $errcount + 1 ))

      if [ ${deck[$randomcard]} -ne 0 ] ; then
	picked=${deck[$randomcard]}
	deck[$picked]=0		# picked, remove it
	# echo randomly picked $picked
        return $picked
      fi
    done

    # If we get here, we've been uanble to randomly pick a card
    # so now we'll just step up until we find an available card

    randomcard=1

    while [ ${deck[$randomcard]} -eq 0 ]
    do
       randomcard=$(( $randomcard + 1 ))
    done

    picked=$randomcard
    deck[$picked]=0		# picked, remove it
    # echo fell through, picked $picked
    return $picked
}

function shuffleDeck
{
    count=1

    while [ $count -le 52 ]
    do
      pickCard
      newdeck[$count]=$picked
      # echo " .. pickCard returned $picked"
      count=$(( $count + 1 ))
    done
}

function showCard
{
   card=$1

   if [ $card -lt 1 -o $card -gt 52 ] ; then
     echo "Bad card value: $card"
     exit 1
   fi

   suite="$(( ( ( $card - 1) / 13 ) + 1))"
   rank="$(( $card % 13))"

   case $suite in
     1 ) suite="Hearts"	  ;;
     2 ) suite="Clubs"    ;;
     3 ) suite="Spades"   ;;
     4 ) suite="Diamonds" ;;
     * ) echo "Bad suite value: $suite"; exit 1
   esac 

   case $rank in
     0 ) rank="King" 	;;
     1 ) rank="Ace"	;;
     11) rank="Jack"    ;;
     12) rank="Queen"   ;;
   esac

   cardname="$rank of $suite"
}

function handValue
{
   # feed this as many cards as are in the hand. This uses weird Baccarat
   # hand value scoring: 1-9 are their own point values, 10,J,Q,K are 0
   handvalue=0	# initialize
   for cardvalue
   do
     if [ $cardvalue -ge 0 ] ; then
       rankvalue=$(( $cardvalue % 13 ))
       case $rankvalue in
         0|11|12 ) rankvalue=0 	;;
         1       ) rankvalue=11	;;
       esac

       handvalue=$(( $handvalue + $rankvalue ))
     fi
   done

   handvalue=$(( $handvalue % 10 ))
}

function dealBanker
{
    # Banker draws a card
    banker[$nextbankercard]=${newdeck[$nextcard]}

    handValue ${banker[1]} ${banker[2]} ${banker[3]}
    bankerhandvalue=$handvalue

    echo -n "Banker takes a card: "
    showCard ${banker[$nextbankercard]}
    echo "$cardname (hand value = $bankerhandvalue)"
}

function showResult
{
   # This determines who wins: "Banker", "Player" or "Tie". 

   if [ $bankerhandvalue -gt $playerhandvalue ] ; then
     echo "Banker wins"
     result=1
   elif [ $bankerhandvalue -lt $playerhandvalue ] ; then
     echo "Player wins"
     result=2
   else
     echo "Tie"
     result=3
   fi
}

#################################################################
####  The main code block ....

initializeDeck
shuffleDeck

cat << EOF

Welcome to Baccarat. You can choose to either stake the player or banker
to win this game. Remember, face cards are worthless and all point values are
modulo 10, with '9' the best possible hand value. We're using Punto Banco
rules with this simulation, if you're already an expert...

EOF

player[1]=${newdeck[1]}
player[2]=${newdeck[3]}
nextplayercard=3	# player starts with two cards

banker[1]=${newdeck[2]}
banker[2]=${newdeck[4]}
nextbankercard=3	# banker also has two cards

nextcard=5		# we've dealt the first four cards already
playerDrewCard=0	# not yet, at least

# now we show both hands and call out the values...

handValue ${player[1]} ${player[2]}
playerhandvalue=$handvalue
handValue ${banker[1]} ${banker[2]}
bankerhandvalue=$handvalue

# Step 1: show both hands, ascertain if there's an immediately endgame
# situation where player or banker has 8 or 9...

echo -n "** Player was dealt: "
showCard ${player[1]} ; echo -n "$cardname, "
showCard ${player[2]} ; echo "$cardname (hand value = $playerhandvalue)"
echo -n "** Banker was dealt: "
showCard ${banker[1]} ; echo -n "$cardname, "
showCard ${banker[2]} ; echo "$cardname (hand value = $bankerhandvalue)"
echo ""

if [ $playerhandvalue -ge 8 -o $bankerhandvalue -ge 8 ] ; then
  echo -n "Play is complete. "
  showResult
  echo ""
  exit 0
fi

# Step 2: Now, let's see if the player can draw a card. This can only
#  happen if the player has an initial total of 0-5

if [ $playerhandvalue -lt 6 ] ; then
  playerDrewCard=1
  player[$nextplayercard]=${newdeck[$nextcard]}

  handValue ${player[1]} ${player[2]} ${player[3]}
  playerhandvalue=$handvalue

  echo -n "Player takes a card: "; showCard ${player[$nextplayercard]}
  echo "$cardname (hand value = $playerhandvalue)"

  nextplayercard=$(( $nextplayercard + 1 ))
  nextcard=$(( $nextcard + 1 ))
fi

# Step 3: the complicated rules of whether the Banker takes another
# card or not, the essence of what makes Baccarat an interesting game...

if [ $playerDrewCard -eq 0 ] ; then
  if [ $bankerhandvalue -lt 6 ] ; then
    dealBanker;
  fi
else
  # Player drew a card. Now the rules get complicated...

  pdcRank=$(( ${player[3]} % 13 ))

  if [ $pdcRank -eq 2 -o $pdcRank -eq 3 ] ; then
    if [ $bankerhandvalue -lt 5 ]; then
      dealBanker;
    fi
  elif [ $pdcRank -eq 4 -o $pdcRank -eq 5 ] ; then
    if [ $bankerhandvalue -lt 6 ] ; then
      dealBanker;
    fi
  elif [ $pdcRank -eq 6 -o $pdcRank -eq 7 ] ; then
    if [ $bankerhandvalue -lt 7 ] ; then
      dealBanker;
    fi
  elif [ $pdcRank -eq 8 -a $bankerhandvalue -lt 3 ] ; then
    dealBanker;
  elif [ $pdcRank -eq 9 -o $pdcRank -eq 0 ] ; then
    if [ $bankerhandvalue -lt 4 ] ; then
      dealBanker;
    fi
  fi
fi

echo ""
echo -n "Play is complete. "
showResult
echo ""

exit 0
Comandos, Shell Script

DebConf12 Nicaragua fechas confirmadas (dates confirmed)

Dec 1st

Posted by javico in Software Libre

No comments

In English


DebConf12 Nicaragua dates confirmed

DebConf12 to take place in Managua, Nicaragua in July 2012

The Debian Project, the team behind the free Debian operating system, has confirmed the dates and venue for its next annual conference, DebConf12.

The conference will take place from July 8 to July 14 2012, in Managua, Nicaragua. In DebConf’s twelve-year history, this will be the first time it will be held in Central America.

Every year, DebConf allows new and existing Debian project participants from around the world to assemble, share knowledge, make collaborative contributions to Debian, and build tighter community bonds. Conference costs are largely funded by corporate sponsors who find significant value in enabling Debian’s success.

“The members of the Debian community in Nicaragua, working together with their fellow communities in Central America, are very excited to be hosting this event, and are happy to welcome our colleagues from around the world to join us in Managua at this very important and productive conference” says Leandro G&oacute;mez, leader of the local team for DebConf12. “This conference will boost the local Debian and Free Software communities and help to bring awareness for the Debian Project, with new contributors and enthusiasts from our country and the surrounding region joining the Debian community and helping Debian to build the best operating system.”

DebConf will be preceded by a day when it opens its doors to the general public, commonly called Debian Day. There will be talks and demonstrations about the benefits of Debian and Free and Open Source software in general to corporate, governmental, academic, and individual users.

The call for papers and registration will open in early 2012.

DebConf12 will be preceded by DebCamp, the yearly developer work sessions, starting on July 1.

The final calendar of the event is:

  • July 1-7 2012: DebCamp, the yearly developer work sessions
  • July 7 2012: Debian Day
  • July 8-14 2012: DebConf12
  • July 15 2012: Departure/cleanup day

 

En Español:
DebConf12 se celebrará en Managua, Nicaragua en julio de 2012.

El proyecto Debian, el equipo detrás del sistema operativo libre Debian, ha confirmado la fecha y la sede para la próxima conferencia anual llamada DebConf12.

La conferencia tendrá lugar del 8 al 14 de julio de 2012, en Managua, Nicaragua. En doce años de historia de la DebConf, esta será la primera vez que tendrá lugar en América Central.

Cada año, DebConf permite a los participantes del proyecto Debian, ya sean recién llegados o con experiencia en el proyecto, y que se encuentran repartidos por todas las partes del mundo, reunirse, compartir conocimiento, realizar contribuciones colaborativas a Debian y construir lazos más estrechos en la comunidad. Los costos de la conferencia son en gran parte financiados por patrocinadores corporativos, quienes encuentran un valor significativo en apoyar el éxito de Debian.

«Los miembros de la comunidad Debian en Nicaragua, trabajando juntos con sus comunidades amigas en América Central, están emocionados por alojar este evento, y están felices de dar la bienvenida a nuestros colegas de todo el mundo para unirse en Managua en esta conferencia productiva e importante.» dijo Leandro Gómez, el líder del equipo local de la DebConf12. «Esta conferencia estimulará a las comunidades de Debian y de Software Libre locales, ayudará a crear conciencia del proyecto Debian, con nuevos contribuidores y entusiastas de nuestro país y de la región uniéndose a la comunidad Debian y ayudar a
desarrollar el mejor sistema operativo.»

DebConf será precedida por un día donde se abren las puertas al público en general, comúnmente llamado Día Debian. Habrá charlas y demostraciones sobre los beneficios de Debian y Software Libre en general a la empresa privada, el gobierno, los estudiantes y los usuarios individuales.

El registro se abrirá a inicios de 2012.

DebConf12 será precedida por DebCamp, las sesiones de trabajo anual de desarrolladores, que comenzarán el 1 de julio.

El calendario final del evento es:

  • 1-7 de julio de 2012: DebCamp, sesiones de trabajo
  • 7 de julio de 2012: Día Debian
  • 8-14 de de julio, 2012: DebConf12
  • 15 julio de 2012: Despedida y limpieza

 

Debian, Eventos
« First...«23456»102030...Last »
  • Búsqueda

  • Últimos Tweets

    Loading tweets...
    Follow me on Twitter!
  • Libros

    • Recent comments
    • Popular posts
    • Archives
    • Tags
    Android Apple Bash Blog BSD CentOS cifs Comandos Comparativa Debian Distribuciones EBook Eventos fedora find Firefox FSF Gentoo GNOME GNU Juegos KDE Kernel KVM LibreOffice Linus Torvalds Linux mplayer nfs Novell OpenSuSE PHP proxy Red Hat Richard Stallman Ruby on Rails Shell Script Software Libre Spacewalk Ubuntu Unix vi Videos Virtualbox Xen
    • February 2012
    • January 2012
    • December 2011
    • November 2011
    • October 2011
    • September 2011
    • August 2011
    • July 2011
    • June 2011
    • May 2011
    • April 2011
    • March 2011
    • February 2011
    • January 2011
    • December 2010
    • November 2010
    • October 2010
    • September 2010
    • August 2010
    • July 2010
    • June 2010
    • May 2010
    • March 2010
    • February 2010
    • January 2010
    • December 2009
    • November 2009
    • Cómo instalar el XMMS en Ubuntu 10.04 (lucid) (5)
    • Como compilar ConkyWizard (4)
    • Manifiesto “En defensa de los derechos fundamentales en Internet” (3)
    • Ruby on Rails – Part 6: Configuration and Deploy (3)
    • Como arreglar el problema de depencia libstdc++5 en Ubuntu 10.04 (3)
    • Manuel: Muy buena tu revision, me gusto, ahora con mas animo a probar esta distribucion, asi mismo seria...
    • max1679: disculpas como puedo conectarme a una red wifi si tiene proxi desde una tablet hptouchpad?
    • mi IP: Gracias por los tips Jose. Saludos desde España
    • Rodrigo: A mi también me gusta, es una interfaz muy cuidada y muy optimizada para la resolución de pantalla d...
  • Blogroll

    • Camino de Santiago
    • Corazón de La Mancha
    • Manchegox
    • Mobile Me
  • RSS Corazón de La Mancha

    • [Rumores] Especificaciones del Samsung Galaxy S III
    • Jack Bauer interrogando a Papa Noel
    • ¿Has alcanzado la paz interior?
    • Calles de fuego – Streets of Fire – Película recomendada
    • Juega gratuitamente al Angry Birds Rio Online
Copyright © 2012 Todos con Software Libre
RSS Feeds XHTML 1.1 Top
PR