1. SSH into your production server:
    ssh forge@purpleturtles.com
  2. Make sure python and git are installed:
    sudo apt-get install git python
  3. Download the LetsEncrypt client from git:
    cd ~
    git clone https://github.com/letsencrypt/letsencrypt
    cd letsencrypt
  4. Turn off nginx temporarily for the installation process:
    sudo service nginx stop
  5. Lets run the installer:
    sudo ./letsencrypt-auto certonly --standalone --agree-tos --redirect --duplicate --text --emailadmin@purpleturtles.com -d purpleturtles.com -d http://www.purpleturtles.com
  6. All done! Let’s turn nginx back on:
    sudo service nginx start
  7. Open a browser and log into Laravel Forge

Deja un comentario

Corregir dependencias en un .deb

mkdir tmp
dpkg-deb -R original.deb tmp
# vi DEBIAN/control
dpkg-deb -b tmp fixed.deb

Dentro del fichero control, hay:

Package: libkf5akonadicore5 
Source: kdepimlibs 
Version: 4:15.12.1+git20160203.1458+15.10-0 
Architecture: amd64 
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> 
Installed-Size: 2217 
Section: libs 
Priority: optional 
Multi-Arch: same 
Homepage: http://pim.kde.org/ 
Description: Akonadi core library 
 This library contains Akonadi PIM data server core classes. 
 This package is part of the KDE Development Platform PIM libraries module. 
Original-Maintainer: Debian/Kubuntu Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Se borran las dependencias y las recomendaciones.

Se compila de nuevo y se instala.

Deja un comentario

AS400 – Configuración Básica

1. Configuring Ethernet

  • Power on your AS/400
  • Signon as QSECOFR on a 5250 workstation


  1. Enter command wrkhdwrsc *cmn to find out what Ethernet adapter is installed and the resource name assigned to it
    Work with Communication Resources
    Type options, press Enter.
    5=Work with configuration descriptions   7=Display resource detail

    Opt Resource Type Status Text
      CMB01 675A Operational Combined function IOP
        LIN01 2720 Operational Communication Adapter
          CMN01 2720 Operational Communication Port
        LIN02 2720 Operational LAN Adapter
          CMN02 2838 Operational Ethernet Port

    2723=10MbEthernet  2838=10/100MbEthernet
    Figure 1 – Work with Communication Resources

  2. Enter the following command to create an Ethernet line
    crtlineth lind(ETHLINE) rsrcname(CMN02) linespeed(100M)
  3. Check the Ethernet cable. One side should be connected to the AS/400, the other side should be connected to the Ethernet hub.
  4. Enter the following command to vary on the line
    vrycfg cfgobj(ETHLINE) cfgtype(*lin) status(*on)
  5. To check the line status enter command
    wrkcfgsts cfgtype(*lin) cfgd(ETHLINE)
    Note that the line will display the VARIED ON status until TCP/IP is started.

2. Configuring TCP/IP

  1. Enter command cfgtcp to receive the following menu
    Configure TCP/IP
    Select one of the following:

       1. Work with TCP/IP interfaces
    2. Work with TCP/IP routes
    3. Change TCP/IP attributes
    4. Work with TCP/IP port restrictions
    5. Work with TCP/IP remote system information
    10. Work with TCP/IP host table entries
    11. Merge TCP/IP host table
    12. Change TCP/IP domain information
    20. Configure TCP/IP applications
    21. Configure related tables
    22. Configure point-to-point TCP/IP

    Figure 2 – Configure TCP/IP

  2. To assign an IP address to the AS/400, select 1:
    Work with TCP/IP Interfaces
    Type options, press Enter.
    1=Add 2=Change 4=Remove 5=Display 9=Start 10=End

    Opt Internet

    Figure 3 – Work with TCP/IP Interfaces

  3. Type 1 and press Enter to define your TCP/IP interface (substitute our sample values with your; see your checklist):
    Add TCP/IP Interface (ADDTCPIFC)
    Type choices, press Enter.

    Internet address . . . . . . . .  >    
    Line description . . . . . . . . ethline    Name, *LOOPBACK…
    Subnet mask. . . . . . . . . . .  
    Associated local interface . . . *NONE          
    Type of service. . . . . . . . . *NORMAL    *MINDELAY, *MAXTHRPUT…
    Maximum transmission unit. . . . *LIND       576-16388, *LIND
    Autostart. . . . . . . . . . . . *YES *YES, *NO
    PVC logical channel identifier     001-FFF
    + for more values    
    X.25 idle circuit timeout. . . . 60     1-600
    X.25 maximum virtual circuits. . 64     0-64
    X.25 DDN interface . . . . . . . *NO  *YES, *NO
    TRLAN bit sequencing . . . . . . *MSB *MSB, *LSB

    Figure 4 – Add TCP/IP Interface

    As an alternative, you may define the IP address of your AS/400 by entering the following command
    addtcpifc intnetadr(‘‘) lind(ethline)

  4. To start this TCP/IP interface, select it with 9=Start from the screen in Figure 3,
    or just enter command
    strtcpifc intnetadr(‘‘)
  5. You should now add a Default Gateway (or route) to your AS/400 configuration. This would allow the AS/400 to route to yourInternet service provider the conversations which cannot be handled on the local network.
    • From the menu in Figure 2 select option 2. Work with TCP/IP routes:
      Work with TCP/IP Routes
      Type options, press Enter.
      1=Add 2=Change 4=Remove 5=Display


      Figure 5 – Work with TCP/IP Routes

    • select option 1=Add to add a default route (substitute our sample value with your; see your checklist):
      Add TCP/IP Route (ADDTCPRTE)
      Type choices, press Enter.

      Route destination. . . . . . . .  >  *dftroute        
      Subnet mask. . . . . . . . . . .  >  *none           
      Type of service. . . . . . . . .   *NORMAL    *MINDELAY, *MAXTHRPUT…
      Next hop . . . . . . . . . . . .  >    
      Preferred binding interface. . .   *NONE          
      Maximum transmission unit. . . .   *IFC        576-16388, *IFC
      Route metric . . . . . . . . . .   1      1-16
      Route redistribution . . . . . .   *NO;  *YES, *NO
      Duplicate route priority . . . .   5      1-10

      Figure 6 – Add TCP/IP Route

    • after this, the screen Work with TCP/IP routes looks as follow:
      Work with TCP/IP Routes
      Type options, press Enter.
      1=Add 2=Change 4=Remove 5=Display

        *DFTROUTE         *NONE        *NONE

      Figure 7 – Work with TCP/IP Routes

3. Defining names and tables

  1. You are now going to define the AS/400 host name, its domain name, and its DNS server addresses.
    From the menu in Figure 2 select option 12. Change TCP/IP domain information (or prompt command chgtcpdmn); please substitute our sample values with your; see your checklist.

    Change TCP/IP Domain (CHGTCPDMN)
    Type choices, press Enter.

      Host name. . . . . . . . . . . .   myas400‘             
      Domain name. . . . . . . . . . .   mydomain.it‘      
      Host name search priority. . . .   *LOCAL  *REMOTE, *LOCAL, *SAME
      Domain name server:
    Internet address . . . . . . .‘  ‘     

    Figure 8 – Change TCP/IP Domain

    Please note that the host name is up to you; it may be different from the one you display with command dspneta.

  2. Now you have to update the host table with the host name of your AS/400.

    • From the menu in Figure 2 select option 10. Work with TCP/IP host table entries (or use command addtcphte, seeFigure 10):
      Work with TCP/IP Host Table Entries
      Type options, press Enter.
      1=Add 2=Change 4=Remove 5=Display 7=Rename


      Figure 9 – Work with TCP/IP Host Table Entries

    • Type 1=Add on the first line and press Enter.
      Add TCP/IP Host Table Entry (ADDTCPHTE)
      Type choices, press Enter.

        Internet address . . . . . . . .   >‘   
        Host names  
      Name . . . . . . . . . . . . .     myas400.mydomain.it‘   
      Name . . . . . . . . . . . . .     mydomain.it‘           
      + for more values   
        Text ‘description’ . . . . . .                               

      Figure 10 – Add TCP/IP Host Table Entry

      It’s important that you specify two host names:

      • the full one, in the format host_name.domain_name
      • and the domain_name by itself

      to allow a correct routing of the electronic mail from the service provider.

    • after this, the screen Work with TCP/IP Host Table Entries looks as follow:
      Work with TCP/IP Host Table Entries
      Type options, press Enter.
      1=Add 2=Change 4=Remove 5=Display 7=Rename


      Figure 11 – Work with TCP/IP Host Table Entries

  3. You should now specify the User ID and Address that the mail services will use to route mail that have an internet address as recipients. Operate as follow:
    • Enter command chgdsta (Change Distribution Attributes) and press F4. Make sure that the Distribution Attributes are as follow:
      Change Distribution Attributes (CHGDSTA)
      Type choices, press Enter.
      Keep recipients . . . . . . . .    *BCC       *SAME, *BCC, *ALL, *NONE
      Use MSF for local . . . . . . . *NO   *SAME, *NO, *YES
      Route to SMTP gateway:
        User ID . . . . . . . . . . . INTERNET Character value, *SAME, *NONE
        Address . . . . . . . . . . . SMTPRTE  Character value

      Figure 12 – Change Distribution Attributes

    • Then use command wrkdire and use option 1 to add the following system directory entry:
      Add Directory Entry
      Type choices, press Enter.
      User ID/Address . . . .   INTERNET   SMTPRTE 
      Description . . . . . . user id to route internet mail  
      System name/Group . . . INTERNET              F4 for list
      User profile . . . . .                       F4 for list
      Network user ID . . . . INTERNET SMTPRTE                
      … etc. …
      System name and group not found. Press Enter to confirm.

      Figure 13 – Add Directory Entry, part 1

      page fown four times, then enter the following data

      Add Directory Entry
      Mail service level  . .  1      1=User index

      Preferred address . . .  9      9=Other preferred address

      Address type . . . .   ATCONTXT
      For choice 9=Other preferred address:
      Field name . . . .    NETUSRID    *IBM   

      Figure 14 – Add Directory Entry, part 2

4. Autostarting the TCP/IP servers

While some TCP/IP servers are already configured for autostarting at the TCP/IP start, some other are not. These are:
the HTTP server (WEB server), the SMTP server (e-mailer towards the Internet), and the POP3 server (e-mailer towards the internal users). This is how you may autostart these three servers.

  1. Use command go tcpadm to display the TCP/IP Administration menu
    TCP/IP Administration
    Select one of the following:

       1. Configure TCP/IP
    2. Configure TCP/IP applications
    3. Start TCP/IP
    4. End TCP/IP
    5. Start TCP/IP servers
    6. End TCP/IP servers
    7. Work with TCP/IP network status
    8. Verify TCP/IP connection
    9. Start TCP/IP FTP session
    10. Start TCP/IP TELNET session
    11. Send TCP/IP spooled file
    20. Work with TCP/IP jobs in QSYSWRK subsystem

    Figure 15 – TCP/IP Administration

    then select option 2 to display the Configure TCP/IP Applications menu

    Configure TCP/IP Applications
    Select one of the following:

       1. Configure SNMP agent
    2. Configure RouteD
    3. Change Trivial FTP Attributes
    4. Configure BOOTP
    5. Change DDM TCP attributes
    6. Change DHCP attributes
    10. Change FTP attributes
    11. Configure TELNET
    12. Configure SMTP
    13. Change LPD attributes
    14. Configure HTTP
    15. Configure workstation gateway
    16. Change POP attributes
    17. Change REXEC attributes
    18. Change DNS attributes

    Figure 16 – Configure TCP/IP Applications

  2. To change the HTTP server select option 14. Configure HTTP from the menu in Figure 17,
    then select option 1. Change HTTP attributes
    (or just prompt command chghttpa):

    Change HTTP Attributes (CHGHTTPA)
    Type choices, press Enter.

    Autostart. . . . . . . . . . . .   *YES *YES, *NO, *SAME
    Number of server threads:
    Minimum. . . . . . . . . . . . 10   1-999, *SAME, *DFT
    Maximum. . . . . . . . . . . . 40   1-999, *SAME, *DFT, *NOMAX
    Coded character set identifier 00819  1-65533, *SAME, *DFT
    Server mapping tables:
    Outgoing EBCDIC/ASCII table. . *CCSID     Name, *SAME, *CCSID, *DFT
    Library. . . . . . . . . . .            Name, *LIBL, *CURLIB
    Incoming EBCDIC/ASCII table. . *CCSID     Name, *SAME, *CCSID, *DFT
    Library. . . . . . . . . . .            Name, *LIBL, *CURLIB

    Figure 17 – Change HTTP Attributes

  3. To change the SMTP server select option 12. Configure SMTP from the menu in Figure 16,
    then select option 3. Change SMTP attributes
    (or just prompt command chgsmtpa):

    Change SMTP Attributes (CHGSMTPA)
    Type choices, press Enter.

    Autostart. . . . . . . . . . . .   *YES *YES, *NO, *SAME
    … etc …

    Figure 18 – Change SMTP Attributes

  4. To change the POP server select option 16. Change POP attributes from the menu in Figure 16
    (or just prompt command chgpopa):

    Change POP Server Attributes (CHGPOPA)
    Type choices, press Enter.

    Autostart. . . . . . . . . . . .   *YES *YES, *NO, *SAME
    … etc …

    Figure 19 – Change POP Server Attributes

  5. Once this is done, enter command
    to start TCP/IP.
  6. About Mail Service Framework (MSF)
    MSF controls the AS/400 mail services.
    It starts at IPL time.
    However, as you just changed the TCP/IP configuration, you have to restart it by entering the following commands
    endmsf option(*immed)
    For more information about MSF, please check IBM AS/400 redbook SG24-4703 AS/400 Electronic-Mail Capabilities .

5. Autostarting TCP/IP at IPL time

Before OS/400 V4R4, to autostart your TCP/IP at IPL time, you have to add some instructions for the QSTRUP startup program.
Starting with V4R4, you may obtain the same by adding an autostart job entry to subsystem QSYSWRK.
Enter the following commands

  1. grtobjaut obj(qsys/strtcp) objtype(*cmd) user(qpgmr) aut(*use)
  2. chgjobd jobd(qsys/qtocstrtcp) jobq(qsys/qsysnomax)
  3. addaje sbsd(qsys/qsyswrk) job(struptcpip) jobd(qsys/qtocstrtcp)

Leer el resto de esta entrada »

Deja un comentario

kill a running virtual machine using ESXTOP

Sometimes it is necessary to kill a running virtual machine process (eg. if there is locked file).

Of course you can do this with the kill command: „kill -9 PID“ …or you can do it in ESXTOP!

.) run ESXTOP
.) press „c“ to open the CPU view
.) press „f“ to add/remove fields
.) press „c“ to add the field LWID Leader World Id (World Group ID)
.) press „k“ to open the kill prompt:

.) type in the LWID from the target virtual machine
.) wait 30 seconds and take care that the process is no longer listed

Deja un comentario

List of most common VMware ESXi SSH/CLI commands

Below is a list of most common CLI commands for VMWare ESXi. Type these in directly in an ESXi or SSH shell.

vim-cmd vmsvc/getallvms List all VMs running on the host. Also provides vmid, required for commands below.
vim-cmd vmsvc/power.off vmid Power off specified VM.
vim-cmd vmsvc/power.on vmid Power off specified VM.
vim-cmd vmsvc/power.reboot vmid Reboot specified VM.
vim-cmd solo/registervm /vmfs/volume/datastore/subdir/vm-file.vmx Register the VM stored at location on the ESX host inventory.
vim-cmd vmsvc/unregister vmid Unregister VM from the host. Does not remove the VM’s files from the datastore.
vim-cmd vmsvc/destroy vmid Delete the specified VM. The VMDK and VMX files will be deleted from storage as well.
vim-cmd vmsvc/tools.install vmid Initiates an installation of VMWare Tools on the VM
vim-cmd hostsvc/maintenance_mode_enter Put the host into maintenance mode.
vim-cmd hostsvc/maintenance_mode_exit Take the host out of maintenance mode.
vim-cmd hostsvc/net/info Show networking information of the host.
chkconfig -l Show services running on the host. Can also be used to change startup configuration.
esxtop Display list of processes and its usage of resources. Works similar to linux top.
esxcfg-info Show host’s configuration and information.
esxcfg-nics -l Show current NIC configuration.
esxcfg-vswitch -l Show current vSwitch configuration.
vmkerrcode -l Display a reference list of VMKernel return codes and descriptions.
dcui Start the console UI (when accessing through SSH).
vsish Run the VMWare Interactive Shell (from SSH).
decodeSel /var/log/ipmi_sel.raw Read IPMI system log of physical server.

Replace vmid with the value you retrieved from the getallvms command (first one in the table).
Replace path with the full path and file name of a VMX-file (= configuration file of a VM).

Deja un comentario

Mantener fecha original al copiar ficheros/fotos con android

A veces he tenido que hacer copia de seguridad de las fotos que tengo en el móvil (Galaxy Note2) y pasarlas a la tarjeta SD o al ordenador.

Y cada vez que hacía una copia de las fotos, la fecha de la foto cambiaba y se ponía la actual del sistema. Es decir, que si las copiaba hoy, todas las fotos tenían fecha de hoy. Y eso no es muy correcto…

He probado de todo para que las fotos tegan la fecha y hora original. Importando como MTP, desde un backup, haciendo un ZIP, haciendolo por adb push, etc…. todo lo imaginable.

Hasta que un día me dió la ventolera y probé con el ADB PUSH pero en modo Recovery, y voilá… funcionó.

Los pasos serían;

1.- Reiniciar en modo recovery (yo uso TWRP) pero me imagino que con CWM funcionará igual.

2.- Usa adb push para “enviar” las fotos o carpetas que quieras.

3.- Reinicia en modo normal.

Y eso es todo. Ya tendrás las fotos con la fecha intacta.

Imagino que funcionará tanto en Windows como en Linux, pero la prueba la hice con un Windows 7.

Hay que tener en cuenta que todo lo que subas desde adb push, se subirá como usuario ROOT, por lo que cuando arranques no podrás renombrar, ni borrar ni nada. Hay que cambiar los permisos.

Iniciado en Recovery, ejecuta:

adb shell
cd /sdcard/
ls -l
Comprueba el nombre del usuario y el grup de la mayoría de los ficheros.

Y ahora cambia el usuario y el grupo con el comando chown

chown -R user:group ./directorio
e.g.: chown -R media_rw:media_rw ./Pictures/Instagram


He descubierto como modificar las fechas de los archivos directamente desde el dispositivo.

Al entrar con un adb shell tenemos que acceder como root a la carpeta de Camera o DCIM o a la carpeta donde se guarden las fotos que queremos modificar.

Tras acceder a la carpeta, ejecutaremos los siguientes comandos:

ls *.jpg > listado.txt

ls *.jpg | awk ‘{print substr($0,5,8)}’ > fecha.txt

Y por último ejecutaremos el touch para cambiar las fechas a las fotos.

while read -r a && read -r b <&3; do touch -t $a $b; done < fecha.txt 3<listado.txt

En un linux (Debian, por ejemplo) se cambia el parámetro -t por -d

while read -r a && read -r b <&3; do touch -d $a $b; done < fecha.txt 3<listado.txt

Deja un comentario

Conocer ip publica, y mandarla por correo con tarea cron

Si tienes una IP dinámica asignada por tu ISP ahora tienes una solución por si en el peor de los momentos, decide cambiartela por otra. A ver como entras por SSH o por donde quieras a tu raspberry.

Con curl haremos una petición a alguna web que te dice tu ip. En este caso a icanhazip.com

Leer el resto de esta entrada »


Deja un comentario