Skip to content

Instantly share code, notes, and snippets.

View vnetmx's full-sized avatar

Alejandro Mendez vnetmx

View GitHub Profile
@vnetmx
vnetmx / make-chr.sh
Created October 25, 2018 17:48 — forked from stroebs/make-chr.sh
Install Mikrotik CHR on a Digital Ocean droplet
wget http://download2.mikrotik.com/routeros/6.40.5/chr-6.40.5.img.zip -O chr.img.zip && \
gunzip -c chr.img.zip > chr.img && \
apt-get update && \
apt install -y qemu-utils pv && \
qemu-img convert chr.img -O qcow2 chr.qcow2 && \
qemu-img resize chr.qcow2 `fdisk /dev/vda -l | head -n 1 | cut -d',' -f 2 | cut -d' ' -f 2` && \
modprobe nbd && \
qemu-nbd -c /dev/nbd0 chr.qcow2 && \
echo "Give some time for qemu-nbd to be ready" && \
sleep 2 && \
@vnetmx
vnetmx / codigo-promocion-digitalocean-2018.md
Created October 18, 2018 18:15
Obten $100USD en crédito para DigitalOcean

Obten $100USD en crédito para DigitalOcean

¿Cómo obtener la promoción?

Nota: Solo aplica para cuentas nuevas.

1.) Usa el siguiente enlace Sign Up y obten $10USD.

2.) Una vez registrado ingresas el código LOWENDBOX cuando vayas a elegir tu metodo de pago y obten $10USD adicionales

En caso de que el descuento no funcione, abre un issue para hacerme saber para borrar el gist.

@vnetmx
vnetmx / months.php
Created May 10, 2018 17:58 — forked from frob/months.php
Long and short month names in a php array.
<?php
$short = array(
'Jan',
'Feb',
'Mar',
'Apr',
'May',
'Jun',
'Jul',
@vnetmx
vnetmx / ssh.cs
Created June 29, 2017 18:11 — forked from piccaso/ssh.cs
ssh.net Example - Keybased Authentication, File Upload, Shell Commands
/*
get SSH.NET (BSD License: http://sshnet.codeplex.com/license)
with NuGet:
>Install-Package SSH.NET -Version 2013.4.7
or just get the dll from here: http://j.mp/sshNet
*/
using System;
@vnetmx
vnetmx / cli_chrome_windows_server.txt
Last active June 7, 2017 12:00 — forked from kurokikaze/gist:350fe1713591641b3b42
install chrome from powershell
# Como instalar Chrome a través de CLI en Windows Server
(new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome_installer.exe', 'c:/temp/chrome.exe');. c:/temp/chrome.exe /silent /install;rm c:/temp -rec
# Works on Win2012
$LocalTempDir = $env:TEMP; $ChromeInstaller = "ChromeInstaller.exe"; (new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome_installer.exe', "$LocalTempDir\$ChromeInstaller"); & "$LocalTempDir\$ChromeInstaller" /silent /install; $Process2Monitor = "ChromeInstaller"; Do { $ProcessesFound = Get-Process | ?{$Process2Monitor -contains $_.Name} | Select-Object -ExpandProperty Name; If ($ProcessesFound) { "Still running: $($ProcessesFound -join ', ')" | Write-Host; Start-Sleep -Seconds 2 } else { rm "$LocalTempDir\$ChromeInstaller" -ErrorAction SilentlyContinue -Verbose } } Until (!$ProcessesFound)
# Nueva versión no probada
$Path = $env:TEMP; $Installer = "chrome_installer.exe"; Invoke-WebRequest "http:
@vnetmx
vnetmx / mongodb_3.2.x_sharding.md
Created February 7, 2017 19:34 — forked from leommoore/mongodb_3.2.x_sharding.md
MongoDB 3.2.x Sharding

#MongoDB 3.2.x Sharding Sharding is used when the database is too large to run on a single server and you need to spread the load across multiple servers. The name itself refers to the breaking (sharding) of the data into seperate groups of data which will reside on different servers.

##Configuration Server Start the server on your server (myserver0)

mongod --configsvr --dbpath /data

On myserver1 start the shard giving the configuration server as the --configdb option

@vnetmx
vnetmx / camera.md
Created February 4, 2017 15:50 — forked from kroko23/camera.md
Cheap chinese IP camera with H264 encoding based on Hisilicon 8M (Hi3518E) chip

Cheap chinese IP camera with H264 encoding based on Hisilicon 8M (Hi3518E) chip

Video stream url for VLC/DVR:

  • rtsp://192.168.1.93:554/user=admin&password=&channel=&stream=.sdp?real_stream--rtp-caching=100

Telnet access

  • telnet 192.168.1.10 23
  • Localhost login: root
  • Password: xmhdipc
@vnetmx
vnetmx / camera.md
Created February 4, 2017 15:50 — forked from kroko23/camera.md
Cheap chinese IP camera with H264 encoding based on Hisilicon 8M (Hi3518E) chip

Cheap chinese IP camera with H264 encoding based on Hisilicon 8M (Hi3518E) chip

Video stream url for VLC/DVR:

  • rtsp://192.168.1.93:554/user=admin&password=&channel=&stream=.sdp?real_stream--rtp-caching=100

Telnet access

  • telnet 192.168.1.10 23
  • Localhost login: root
  • Password: xmhdipc
@vnetmx
vnetmx / camera.md
Created February 4, 2017 15:50 — forked from kroko23/camera.md
Cheap chinese IP camera with H264 encoding based on Hisilicon 8M (Hi3518E) chip

Cheap chinese IP camera with H264 encoding based on Hisilicon 8M (Hi3518E) chip

Video stream url for VLC/DVR:

  • rtsp://192.168.1.93:554/user=admin&password=&channel=&stream=.sdp?real_stream--rtp-caching=100

Telnet access

  • telnet 192.168.1.10 23
  • Localhost login: root
  • Password: xmhdipc
@vnetmx
vnetmx / camera.md
Created February 4, 2017 15:50 — forked from kroko23/camera.md
Cheap chinese IP camera with H264 encoding based on Hisilicon 8M (Hi3518E) chip

Cheap chinese IP camera with H264 encoding based on Hisilicon 8M (Hi3518E) chip

Video stream url for VLC/DVR:

  • rtsp://192.168.1.93:554/user=admin&password=&channel=&stream=.sdp?real_stream--rtp-caching=100

Telnet access

  • telnet 192.168.1.10 23
  • Localhost login: root
  • Password: xmhdipc