Skip to content

Instantly share code, notes, and snippets.

@vicendominguez
vicendominguez / run.sh
Created May 17, 2024 04:57
qemu running stuff oneliner
qemu-system-i386 -enable-kvm -cpu host -m 1024 -device virtio-vga,edid=on,xres=1440,yres=900 -net nic,model=rtl8139 -net user -drive file=winxp.img,format=raw -usb -device qemu-xhci,id=xhci -drive if=none,id=stick,format=raw,file=usb.img -device usb-storage,bus=xhci.0,drive=stick,removable=on -drive file=virtio-win-0.1-94.iso,media=cdrom
@vicendominguez
vicendominguez / gist:528be099c9e3ba471e653896f5c2c42c
Created October 20, 2023 18:41
alias to create a ramdisk in MacOS Ventura
ramdisk() {
if [ "$1" = "on" ]; then
echo creating a 100MB ramdisk:
size=$((2 * 1024 * 100))
device_name=$(hdiutil attach -nomount ram://${size} | awk '{print $1}')
diskutil eraseVolume HFS+ RAMDisk ${device_name}
echo created: /Volumes/RAMDisk
elif [ "$1" = "off" ]; then
echo "Bye RAMDisk... sure? (control+c abort - INTRO byebye)"
read
@vicendominguez
vicendominguez / .vimrc
Last active June 1, 2021 20:24
simple and basic vimrc for golang using vim-plug and vim-go
" Plugins
" external tool dependencies:
" - ripgrep
" - bat
" remember: :PlugInstall
call plug#begin()
Plug 'fatih/vim-go'
Plug 'AndrewRadev/splitjoin.vim'
Plug 'fatih/molokai'
Plug 'scrooloose/nerdtree'
@vicendominguez
vicendominguez / deletefrmbintray.sh
Last active May 17, 2016 05:30 — forked from hgomez/upload2bintray.sh
Helper script to upload/remove RPM packages to/from bintray
#!/bin/bash
#
# You should define BINTRAY_ACCOUNT and BINTRAY_APIKEY here or from the outside
# BINTRAY_ACCOUNT is you Bintray account and BINTRAY_APIKEY, API Key generated under your Bintray profile
# Redefine following variables to match your own usage
BINTRAY_ACCOUNT=vicendominguez
BINTRAY_APIKEY=xxxxxxxxxxxxxxxxx
@vicendominguez
vicendominguez / get_macname.py
Last active December 17, 2015 15:50
Get a name from the publicip and macaddrs
#!/usr/bin/python
import fcntl, socket, struct, urllib2
def getHwAddr(ifname):
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
info = fcntl.ioctl(s.fileno(), 0x8927, struct.pack('256s', ifname[:15]))
return '_'.join(['%02x' % ord(char) for char in info[18:24]])
@vicendominguez
vicendominguez / zabbix-hubot-alert.sh
Created December 17, 2015 11:52
my shellscript to integrate hubot + zabbix + hangouts (post method inside is adapted to hangups)
#!/bin/bash
URL="http://gw.url.net:40001/proxy/"
ID="$1"
MESSAGE="$2"
if [ -z "$ID" ]
then
echo 'ID param not found'
@vicendominguez
vicendominguez / smokeping
Created September 9, 2015 11:21
smokeping init.d script for staves on CentOS
#! /bin/sh
#
# chkconfig: - 70 30
# description: latency logging and graphing system
# processname: smokeping
# Source function library.
. /etc/rc.d/init.d/functions
# Get config.
@vicendominguez
vicendominguez / site_sslgzip.conf
Last active August 29, 2015 14:20
my Global/site_sslgzip.conf for nginx ("A" in sslabs)
#Avoid Poodle
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
#Enable ciphers
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
#ssl_ciphers 'AES128+EECDH:AES128+EDH:!aNULL';
resolver 8.8.4.4 8.8.8.8 valid=300s;
resolv
@vicendominguez
vicendominguez / ansible-linode-template.yml
Last active August 7, 2017 13:21
Ansible Linode template (tested and working)
#### CentOS: yum install pip ; pip install linode-python ; pip install chube
####
- hosts: localhost
connection: local
gather_facts: false
tasks:
- name: Create linode server
linode:
api_key: '---LINODE-API-KEY-HERE---'
@vicendominguez
vicendominguez / linodeinfo.sh
Last active August 29, 2015 14:19
Show full info from Linode API: lists of distributions, datacenters and plans . (nodejs)
#!/usr/bin/env node
// sudo npm install linode-api -g
// Show distribution list & datacenter list & linode plans
var my_api_key = '---KEY-HERE-----';
var client = new(require('linode-api').LinodeClient)(my_api_key);
client.call('avail.distributions', {}, function (err, res) {
if (err) throw err;
console.log(res);