Skip to content

Instantly share code, notes, and snippets.

Julien Barbot klyr

Block or report user

Report or block klyr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:a0be480709959129fa67ca20fe2532dd
pacmd list-sinks | grep name:
pacmd load-module module-remap-sink sink_name=mono master=<name_of_audio sink_given_by_previous_command> channels=2 channel_map=mono,mono
speaker-test -c 2 -t sine
klyr / Makefile
Created May 6, 2019
Makefile for blockdiag
View Makefile
BLOCKDIAG_SOURCES = $(wildcard $(SOURCEDIR)/*.blockdiag)
SEQDIAG_SOURCES = $(wildcard $(SOURCEDIR)/*.seqdiag)
ACTDIAG_SOURCES = $(wildcard $(SOURCEDIR)/*.actdiag)
NWDIAG_SOURCES = $(wildcard $(SOURCEDIR)/*.nwdiag)
klyr / ps1
Created Apr 15, 2019
VMware script executed by vmware tools
View ps1
$vmlog = 'C:\Program Files\vmlogs\vmenv.log'
$getenv = "C:\Program Files\VMware\VMware Tools\vmtoolsd.exe" --cmd="info-get guestinfo.ovfEnv" > "C:\Program Files\vmlogs\vmenv.xml"
Invoke-Expression -Command $getenv
[xml]$vmenv = Get-Content $vmenvxml
$vmIP = $vmenv.Environment.PropertySection.Property | ?{ $_.key -like 'ip_address' } | select -expand value
$vmNetmask = $vmenv.Environment.PropertySection.Property | ?{ $_.key -like 'netmask' } | select -expand value
$vmGW = $vmenv.Environment.PropertySection.Property | ?{ $_.key -like 'default_ateway' } | select -expand value
View Dockerfile
# ============LICENSE_START=======================================================
# org.onap.dcae
# ================================================================================
# Copyright (c) 2018 Cisco Systems. All rights reserved.
# ================================================================================
# Licensed 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
View gist:12f41dda5f39cbb5eefe409d3f7d35b4
klyr /
Last active May 1, 2017
tcpdump useful commands
# From Vincent Bernat
# (-s0 not useful, just an habit)
ssh tcpdump -pni eth0 -s0 -w - -U port 8888 | wireshark -k -i -
klyr /
Last active Mar 20, 2017
Add epel repo with saltstack
sudo salt '*' pkg.mod_repo base enabled=1 name='CentOS-$releasever - Base' mirrorlist='$releasever&arch=$basearch&repo=os' gpgcheck=1
sudo salt '*' pkg.mod_repo update enabled=1 name='CentOS-$releasever - Updates' mirrorlist='$releasever&arch=$basearch&repo=updates' gpgcheck=1
sudo salt '*' pkg.mod_repo epel enabled=1 name='Extra Packages for Enterprise Linux 7 - $basearch' mirrorlist='$basearch' gpgcheck=1
sudo salt '*' pkg.mod_repo epel-testing enabled=1 name='Extra Packages for Enterprise Linux 7 - Testing - $basearch' mirrorlist='$basearch' gpgcheck=1
klyr /
Created Mar 10, 2017
Boot a qcow cloud-init image with kvm
wget $img_url -O disk.img.dist
cat > my-user-data <<EOF
password: changeme
chpasswd: { expire: False }
ssh_pwauth: True
View gist:3f09e55183d9f287d6fe6f8076a4ccc3

Signing someone else key

Get key to sign

gpg --list-keys

Sign the key

gpg --sign-key --ask-cert-level 0xXXXXXXXXX
klyr /
Created Jan 11, 2017
Compact multiple PNDA avro files into one
set -e
for d in $(hdfs dfs -ls -R '/user/pnda/PNDA_datasets/datasets/source=*'|awk '/^d.*hour=..$/ {printf "%s ", $NF}'); do
IN=$(hdfs dfs -ls ${d}/*.avro | awk '{printf "%s ", $NF}')
echo "--- In '$d' Compacting files '${IN}' to '${OUT}'"
hadoop jar /opt/cloudera/parcels/CDH/lib/avro/avro-tools.jar concat ${IN} ${OUT}
hdfs dfs -chown gobblin:pnda ${OUT}
hdfs dfs -rm -skipTrash ${d}/*.avro
hdfs dfs -mv ${OUT} ${d}/compacted.avro
You can’t perform that action at this time.