I hereby claim:
- I am padajuan on github.
- I am padajuan (https://keybase.io/padajuan) on keybase.
- I have a public key whose fingerprint is B885 F4D7 AAB1 6EE6 0871 0776 6557 3E3C C23D C3D9
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| #!/bin/bash | |
| # | |
| # /etc/rc.d/init.d/xvfb | |
| # | |
| # chkconfig: 345 95 28 | |
| # description: Starts/Stops X Virtual Framebuffer server | |
| # processname: Xvfb | |
| # | |
| . /etc/init.d/functions |
| from multiprocessing import Pool | |
| def f(x): | |
| # Put any cpu (only) consuming operation here. I have given 1 below - | |
| while True: | |
| x * x | |
| # decide how many cpus you need to load with. | |
| no_of_cpu_to_be_consumed = 1 |
| #!/bin/bash | |
| # | |
| # backup Startup script for the workshop | |
| # | |
| # chkconfig: 24 86 15 | |
| # description: awakes a workshop script | |
| # processname: backup | |
| # | |
| ### BEGIN INIT INFO | |
| # Provides: backup |
| require 'find' | |
| require 'fileutils' | |
| module Puppet::Parser::Functions | |
| newfunction(:copy_config_files) do |args| | |
| function_notice(["Using copy_config_files script..."]) | |
| ## Get all files with extension as follows | |
| config_files = [] | |
| Find.find(args[1]) do |path| | |
| config_files << path if path =~ /.*\.template$/ |
| #!/bin/bash | |
| # | |
| ######################################### | |
| ##Autor: Juan Manuel Parrilla | |
| ##Descr: This script will remove a especific crontab entry from /etc/crontab file | |
| ######################################### | |
| ## | |
| ## THIS SCRIPT NEED SUDO PERMS TO MODIFY CRONTAB FILE | |
| ## How to use: | |
| ## $1 --> Pattern to find crontab entry (EG) Script name or something |
| #!/bin/bash | |
| ###### | |
| ## OS: Mint 12 / Debian | |
| ## Service: LXDE | |
| ## Desc: This script stop and start the lxde panel if it is hang | |
| ## Auth: Juan Manuel Parrilla | |
| ###### | |
| INSTANCE=/usr/bin/lxpanel | |
| PROFILE=`ps aux | grep $INSTANCE | grep -v grep | awk '{print $13}'` |
| pattern = /.*Total TestCases: ([0-9]) \(([0-9]) failed\)*./ | |
| matcher = manager.getLogMatcher(pattern) | |
| if(matcher?.matches()) { | |
| total = matcher.group(1).toInteger() | |
| fails = matcher.group(2).toInteger() | |
| } | |
| manager.listener.logger.println total | |
| manager.listener.logger.println fails |
| #!/bin/bash | |
| # mongos - Startup script for mongos | |
| # chkconfig: 35 85 15 | |
| # description: Mongo Router Process for sharding | |
| # processname: mongos | |
| # config: /etc/mongo/mongos.conf | |
| # pidfile: /var/run/mongo/mongos.pid |
Copy the Ini file into your home folder and execute this from CLI
Input:
ansible-playbook -i inv mapper.yml -v --extra-vars "pattern=port"
Output:
Using /etc/ansible/ansible.cfg as config file