Skip to content

Instantly share code, notes, and snippets.

View dariobanfi's full-sized avatar
💎

Dario Banfi dariobanfi

💎
View GitHub Profile
@dariobanfi
dariobanfi / playbook.yml
Created June 3, 2022 13:13
Multi-NIC Google Compute Engine Instances example in Ansible
- name: Create a Disk for the VML
google.cloud.gcp_compute_disk:
name: ansible-disk
size_gb: 10
zone: "{{ lookup('env', 'GCP_ZONE') }}"
project: "{{ lookup('env', 'GCP_PROJECT') }}"
auth_kind: serviceaccount
service_account_file: "{{ lookup('env', 'GCP_SERVICE_ACCOUNT_FILE') }}"
state: present
register: disk
@dariobanfi
dariobanfi / cdf
Created February 19, 2021 09:30
cdf command
# cd to the path of the front Finder window
cdf() {
target=`osascript -e 'tell application "Finder" to if (count of Finder windows) > 0 then get POSIX path of (target of front Finder window as text)'`
if [ "$target" != "" ]; then
cd "$target"; pwd
else
echo 'No Finder window found' >&2
fi
}c
/*!
* Bazaarvoice bv-loader v13.2.4
* Tue Sep 15 2020 09:14:26 GMT+0000 (Coordinated Universal Time)
*
* Capabilities:
*
* api@0.7.3
* inline_ratings@2.2.1
* questions@0.2.2
* rating_summary@2.35.0
@dariobanfi
dariobanfi / makepr.sh
Created July 14, 2017 09:42
OsX bash function to open pull requests for GitHub Enterprise accounts
function makepr() {
giturl='github.enterprise.url'
branch=`git rev-parse --abbrev-ref HEAD`
remote=`git remote get-url origin`
if [[ $remote == https* ]]; then
project=$(echo $remote | sed -e "s/.*$giturl\/\(.*\).git.*/\1/")
else
project=$(echo $remote | sed 's%^.*:\([^:]*\)\.git$%\1%g')
fi
open "https://$giturl/$project/compare/$branch?expand=1"
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
ovs-vsctl set bridge s1 protocols=OpenFlow13
ovs-vsctl set bridge s2 protocols=OpenFlow13
ovs-vsctl set bridge s3 protocols=OpenFlow13
ovs-vsctl set bridge s4 protocols=OpenFlow13
ovs-vsctl set bridge s5 protocols=OpenFlow13
# S1 Multipath
ovs-ofctl -O OpenFlow13 add-group s1 group_id=5566,type=select,bucket=weight:200,output:1,bucket=weight:100,output:2
ovs-ofctl -O OpenFlow13 add-flow s1 in_port=4,actions=group:5566
# ovs-ofctl -O OpenFlow13 add-flow s1 in_port=4,actions=output:1
#!/usr/bin/python
from __future__ import division
from mininet.topo import Topo
from mininet.node import CPULimitedHost
from mininet.link import TCLink
from mininet.net import Mininet
from mininet.util import dumpNodeConnections
from mininet.cli import CLI
from mininet.node import OVSController, RemoteController, OVSKernelSwitch
../../modules/video_output/android/android_window.c:1005: error: undefined reference to 'jni_LockAndGetIsSurfaceAttached'
../../modules/video_output/android/android_window.c:970: error: undefined reference to 'jni_LockAndGetIsSurfaceAttached'
../../modules/video_output/android/surface.c:411: error: undefined reference to 'jni_LockAndGetIsSurfaceAttached'
../../modules/video_output/android/surface.c:378: error: undefined reference to 'jni_LockAndGetIsSurfaceAttached'
collect2: error: ld returned 1 exit status
make[1]: *** [obj/local/armeabi-v7a/libvlcjni.so] Error 1
make[1]: Leaving directory `/home/ambi/Desktop/android/libvlc'
make: *** [libvlc/obj/local/armeabi-v7a/libvlcjni.so] Error 2
rm android-libs/libutils.c android-libs/libmedia.c android-libs/libstagefright.c android-libs/libui.c android-libs/libcutils.c android-libs/libbinder.c android-libs/libhardware.c