Skip to content

Instantly share code, notes, and snippets.

View carlossg's full-sized avatar
🦄
Yak shaving

Carlos Sanchez carlossg

🦄
Yak shaving
View GitHub Profile
@carlossg
carlossg / jruby-json.rb
Last active February 16, 2023 15:27
JRuby json conversion
# test conversion of Java objects to json in JRuby
# jrjackson is the only gem doing it right, the others quote the result
# the trick for the other ones is to convert maps and lists to ruby hashes and arrays before
array = java.util.ArrayList.new().to_array
list = java.util.ArrayList.new()
map = java.util.HashMap.new()
nested = { :list => list }
require 'jrjackson'
@carlossg
carlossg / logi-mute.sh
Created February 23, 2021 20:35
Remote control key re-mapping in macOS
#!/bin/bash -eux
# Remote control key re-mapping in macOS
# Maps right arrow to M so you can mute/unmute in BlueJeans
# You'll need to determine your specific ProductID
# You can find ProductIDs for internal and external devices at the following location:
# Apple icon > About This Mac > System Report > USB (under Hardware section in left panel)
# These changes will be reverted after each restart.
@carlossg
carlossg / Dockerfile
Created December 17, 2014 19:19
ansible maven
FROM ansible/centos7-ansible:stable
# or, for example, FROM ansible/ubuntu14.04-ansible:stable
RUN yum install -y tar
RUN ansible-galaxy install geerlingguy.java
RUN ansible-galaxy install https://github.com/silpion/ansible-maven.git
# Add playbooks to the Docker image
COPY site.yml /
@carlossg
carlossg / jx-alibaba-china.md
Last active June 21, 2019 07:43
jenkins-x alibaba china

Using jx cli 2.0.283 and platform 2.0.634

jx install \
  --provider alibaba \
  --default-admin-password=admin \
  --default-environment-prefix=jx-rocks-china \
  --tekton \
  --docker-registry=registry.cn-beijing.aliyuncs.com \
 --docker-registry-org=jx-rocks \
@carlossg
carlossg / block_personal_appts
Last active September 12, 2018 15:50 — forked from ttrahan/block_personal_appts
Google Apps Script to automatically create, edit and delete events on work calendar for personal calendar events. Instructions on how to set up can be found at https://medium.com/@willroman/auto-block-time-on-your-work-google-calendar-for-your-personal-events-2a752ae91dab
function sync() {
var id="XXXXXXXXX"; // CHANGE - id of the secondary calendar to pull events from
var today=new Date();
var enddate=new Date();
enddate.setDate(today.getDate()+7); // how many days in advance to monitor and block off time
var secondaryCal=CalendarApp.getCalendarById(id);
// var secondaryEvents=secondaryCal.getEvents(today,enddate,{statusFilters: [CalendarApp.GuestStatus.YES]});
@carlossg
carlossg / Jenkinsfile
Last active June 12, 2017 17:50
Kubernetes Hello World
/**
* This pipeline will deploy to Kubernetes
*/
library identifier: 'fabric8-pipeline-library@v2.2.311', retriever: modernSCM(
github(repoOwner: 'fabric8io', repository: 'fabric8-pipeline-library')
)
podTemplate(label: 'deploy', containers: [
containerTemplate(name: 'jnlp', image: 'jenkinsci/jnlp-slave:latest'),
El proyecto Jenkins se ha enterado de que una compañía está intentando registrar "Jenkins" como marca registrada en Colombia. Esto es alarmante y estamos tratando de oponernos. Para hacerlo de manera efectiva, necesitamos escuchar a los usuarios colombianos de Jenkins.
El proyecto Jenkins posee una marca registrada "Jenkins" en los Estados Unidos, a través de una entidad sin ánimo de lucro SPI Inc. Según los expertos en la materia citando la "Convención de Washington", nuestro registro de marca en los EE.UU. nos da algo de fuerza para oponernos. Sin embargo, para argumentar con éxito, tenemos que ser capaces de demostrar que Jenkins tiene un uso significativo y es conocido en Columbia. Usuarios, instalaciones, encuentros, conferencias, cualquier cosa de ese tipo ayudará.
Aquellos que llevan mucho tiempo con el proyecto pueden recordar que el nombre "Jenkins" nació debido a un problema de marca con Oracle. Por lo tanto, somos particularmente sensibles al tema de las marcas registradas. Queremos asegurarnos d
@carlossg
carlossg / videbcontrol.sh
Created January 23, 2014 13:10
Script to change .deb control file and repackage
#!/bin/bash
# Change .deb control file and repackage
# credits Loevborg http://ubuntuforums.org/showthread.php?t=636724&p=3925729#post3925729
if [[ -z "$1" ]]; then
echo "Syntax: $0 debfile"
exit 1
fi
Parse.Cloud.define("hello", function(request, response) {
var xivelyKey = 'YOUR XIVELY KEY';
var feedId = 713578059;
var device = request.params.D;
var channels = {
31: 'Temperature',
30: 'Humidity'
};
var channel = channels[device];
@carlossg
carlossg / onx_wifi_post.js
Last active December 25, 2015 14:08
on{X} rule for POSTing to a url while connected to a specific wifi access point
// Initializing variables
// url to post to. If using ninjablocks this is a webhook you created in the dashboard
var url = "https://api.ninja.is/rest/v0/device/WEBHOOK_0_0_108/subdevice/fIOAY/tickle/xxxxxxxxxxx";
// the wifi SSID
var ssid = "myhomewifi";
// how often to trigger the POST
var seconds = 5*60;
var method = "POST";