Skip to content

Instantly share code, notes, and snippets.

@adocampo
adocampo / slapd
Created June 26, 2023 12:07 — forked from tuxfight3r/slapd
openldap proxy to AD with TLS
#file /etc/sysconfig/slapd
# OpenLDAP server configuration
# see 'man slapd' for additional information
# Where the server will run (-h option)
# - ldapi:/// is required for on-the-fly configuration using client tools
# (use SASL with EXTERNAL mechanism for authentication)
# - default: ldapi:/// ldap:///
# - example: ldapi:/// ldap://127.0.0.1/ ldap://10.0.0.1:1389/ ldaps:///
SLAPD_URLS="ldap:/// ldaps:///"
@adocampo
adocampo / rc-upgrade.sh
Created March 19, 2021 10:48
RocketChat upgrade without "Call Already Ended" check
curl -L https://releases.rocket.chat/latest/download -o /tmp/rocket.chat.tgz
tar -xzf /tmp/rocket.chat.tgz -C /tmp
sed -r --in-place=.bak -e 's/;[a-z>]+(\?[^;]+"Call Already Ended")/;1\1/' /tmp/bundle/programs/web.browser/*.js
cd /tmp/bundle/programs/server && npm install
# there is time to look at warnings from npm and solving if neccesary
systemctl stop rocketchat
rm -rf /opt/Rocket.Chat
mv /tmp/bundle /opt/Rocket.Chat
@adocampo
adocampo / photo2telegram.yaml
Created November 6, 2019 08:41
HA push photo to telegram
camara_salon_snapshot:
alias: 'Capturar imagen recibidor'
sequence:
- service: camera.snapshot
data:
entity_id: camera.salon_camera
filename: '/config/www/snapshot/salon.jpg'
- delay: '00:00:06'
- service: notify.pushnotify
data_template:
@adocampo
adocampo / configuration.yaml
Created November 4, 2019 00:18 — forked from partofthething/configuration.yaml
Home-assistant configuration with some z-wave devices, HUE lights, some custom commands, weather, etc.
homeassistant:
# Name of the location where Home Assistant is running
name: [redacted]
# Location required to calculate the time the sun rises and sets
latitude: [redacted]
longitude: [redacted]
# C for Celcius, F for Fahrenheit
temperature_unit: C
# Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
time_zone: America/Los_Angeles
@adocampo
adocampo / btrfs-undelete
Created October 9, 2019 14:27 — forked from Changaco/btrfs-undelete
btrfs-undelete
#!/bin/bash
# btrfs-undelete
# Copyright (C) 2013 Jörg Walter <info@syntax-k.de>
# This program is free software; you can redistribute it and/or modify it under
# the term of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or any later version.
if [ ! -b "$1" -o -z "$2" -o -z "$3" ]; then
echo "Usage: $0 <dev> <file/dir> <dest>" 1>&2
echo
@adocampo
adocampo / update-rocketchat.sh
Created October 1, 2019 14:54
Little script to update from sources a manually installed RocketChat on a systemd system.
#!/bin/bash
curl -L https://releases.rocket.chat/latest/download -o /tmp/rocket.chat.tgz
tar -xzf /tmp/rocket.chat.tgz -C /tmp
systemctl stop rocketchat.service
mv /opt/Rocket.Chat/ /opt/Rocket.Chat_bak
cd /tmp/bundle/programs/server && npm install
npm i -g npm
sudo mv /tmp/bundle /opt/Rocket.Chat
systemctl start rocketchat.service

Keybase proof

I hereby claim:

  • I am adocampo on github.
  • I am adocampo (https://keybase.io/adocampo) on keybase.
  • I have a public key ASArxrt8r2flYypPBvgovUPZGyRXqP9xhxWvPAxQQz_RKQo

To claim this, I am signing this object:

@adocampo
adocampo / mycroft.service
Created August 21, 2019 07:57
systemd unit file for mycroft service
# The file must be placed on /usr/lib/systemd/user/mycroft.service
# and need to be run as the user who owns the file permissions
# with the command systemctl --user start|enable mycroft.service
[Unit]
Description=Mycroft main service
After=network.target local-fs.target remote-fs.target
[Service]
Type=forking
RemainAfterExit=no
@adocampo
adocampo / .vimrc
Created July 10, 2019 09:29
custom vimrc with more additions
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Maintainer:
" Amir Salihefendic — @amix3k
"
" Awesome_version:
" Get this config, nice color schemes and lots of plugins!
"
" Install the awesome version from:
"
" https://github.com/amix/vimrc
@adocampo
adocampo / fix_espeak_mycroft.sh
Created April 12, 2019 20:07 — forked from zeehio/fix_espeak_mycroft.sh
How to make Spanish espeak say 'mycroft' properly
#!/bin/sh
# 1. Check that espeak fails to transcribe mycroft:
echo "How espeak transcribes 'hola mycroft':"
espeak -v spanish -x -q --pho "hola mycroft"
# 'ola mik**'Oft
echo "How espeak should transcribe 'hola mycroft':"
espeak -v spanish -x -q --pho "hola máicroft"
# 'ola m'aik**Oft