Skip to content

Instantly share code, notes, and snippets.

laurentedel /
Created Oct 13, 2021
simple sensor generator
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""a simple sensor data generator"""
import json
import time
import random
interval_secs = 500 / 1000.0
laurentedel /
Last active Dec 5, 2018 — forked from n0ts/
Get latest Oracle JDK package bash shell script
# You must accept the Oracle Binary Code License
# usage: <jdk_version> <ext>
# jdk_version: 8(default) or 9
# ext: rpm or tar.gz
function start(){
curl -u $user:$pass -i -H 'X-Requested-By: ambari' -X PUT -d \
'{"RequestInfo": {"context" :"Start '"$1"' via REST"}, "Body": {"ServiceInfo": {"state": "STARTED"}}}' \
function startWait(){
curl -s -u $user:$pass -H 'X-Requested-By: ambari' -X PUT -d \
'{"RequestInfo": {"context" :"Start '"$1"' via REST"}, "Body": {"ServiceInfo": {"state": "STARTED"}}}' \
laurentedel / services.ldif
Created Jun 23, 2015
example services.ldif
View services.ldif
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
laurentedel / workingplace.scpt
Created May 15, 2015
applescript working place
View workingplace.scpt
This script is supposed to be exported as "run only"
and crontabed
You must have a "WORKING_PLACE" category in Outlook
It'll simply ask you the location of working for today
and add a fullday event to your calendar
#!/usr/bin/env bash
# password for amon, smon, hmon, rman, nav, scm
cat /etc/cloudera-scm-server/db*.properties | sed '/^#/ d'
# password for cloudera-scm
head -1 /var/lib/cloudera-scm-server-db/data/generated_password.txt
# password for hive
psql -U scm -W scm -h localhost -p 7432 -c "select attr,value from configs where attr like 'hive_metastore_database%' order by revision_id DESC limit 5;"