Updates from October, 2018 Toggle Comment Threads | Keyboard Shortcuts

  • Matthieu Paturot 10:23 am on October 24, 2018 Permalink | Reply  

    Control-M Automation X Ansible X Scripts 

    Here’s three modest python scripts to work with batch jobs in order to automate the PPT reports with Ansible.

    The first one, “control_m-ansible-list_jobs.py” allows to list all jobs for a specific application with the state of your choice :

    control_m-ansible-list_jobs.py -u Matthieu.Paturot -p XXXXX -h XXXXX -app XXXXX -appli XXXXX -i -s "Ended OK"

    Or simply to list all jobs whatever the state:

    control_m-ansible-list_jobs.py -u Matthieu.Paturot -p XXXXX -h XXXXX -app XXXXX -appli XXXXX-i -s "All"

    The second one, “control_m-ansible-action_jobs.py” allows to do an action (runrerunhold) on all jobs with a specific state and a specific application as well :

    control_m-ansible-action_jobs.py -u Matthieu.Paturot -p XXXXX  -h XXXXX -app XXXXX -appli XXXXX -i -s "Ended OK" -a rerun

    BONUS: The big one, the last one, “control_m-interactive-action_jobs.py” as its name implies, it’s interactive. You can choose the state of your choice for a specific application and an action to do (runrerunhold) on the job chosen. It’s only on a case-by-case basis:

    control_m-interactive-action_jobs.py -u Matthieu.Paturot -p XXXXX -h XXXXX -app XXXXX -appli XXXXX -i -s "Wait Condition"

    Or you can choose to see all jobs for a specific application but you can only see details about the job chosen:

    control_m-interactive-action_jobs.py -u Matthieu.Paturot -p XXXXX -h XXXXX -app XXXXX -appli XXXXX -i -s "All"

    PS: You need a token to use API services

    curl -k -H "Content-Type: application/json"  -X POST -d '{"username": "pXXX", "password": "XXX"}'   $endpoint/session/login
    # from the output
    token=.......
     
  • Matthieu Paturot 7:47 pm on February 2, 2018 Permalink | Reply  

    WhatsApp Blocking Peoples 

    Allo ? Hallo !

    I was excited about the idea of connect my (mini) Google Home with WhatsApp, in other words : Send predefined messages thanks to the voice !

    “Ok WhatsApp”

    As I said, I was excited, because during my test everything was working fine for sending WhatsApp messages trough Linux…

    In fact, thanks to YOWSUP, a Python WhatsApp Library, I could send WhatsApp messages from my Linux server :

    /usr/local/bin/yowsup-cli demos -c /srv/yowsup/config -s 33XXXXXXXX "Das ist ein Test"

    I was using a French mobile number (Orange) for my tests and two days ago when I decided to industrialize this on a Samsung Galaxy S5 transformed into a Linux Server with a German mobile number (Deutsche Telekom) : I have been blocked by WhatsApp because I used an illegal application ! I mean YOWSUP !

    Deutsche Telekom: Orange Love

    Anyway, the journey was great, like always It was a path full of pitfalls and like always I love it : spend several hours days to look for the “perfect” howto and to face some problems of production !

    Here’s the pefect howto for play with YOWSUP #NoBullShit

    Here’s one of problems of production :

    OSError: [Errno 13] Permission denied: '/root/.yowsup'

    You can fix it by editing constants.py (yowsup/common/constants.py) and go to :

    PATH_STORAGE = "/xxxx/.yowsup"

    Here’s some remains :

    A Python Web Server with a script to call a situation snapshot and a script for send a predefined WhatsApp message.


    Gut und Günstig

    Nevertheless, there is a (illegal) (paid) solution.

    Briefly, if you want to create an Action Google Home, you need to create an Action Project and if needed create a script hosted on Google Cloud Platform with the choice of your language.

    For our case, we can find nice websites that “offer” a WhatsApp Gateway API with a script for send WhatsApp mesages in your favorite language (Node.js, Java, Shell, Google Apps Script…).

    Then, once paid, you can provide the script during the creation of your Action Google Home

    PS: There are a lot of steps of course for an Action Google Home :)

     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel