Skip to content

Instantly share code, notes, and snippets.

View lcuevastodoit's full-sized avatar
✔️
Verified

LUIS CUEVAS lcuevastodoit

✔️
Verified
  • Bogota DC, Colombia
View GitHub Profile
@lcuevastodoit
lcuevastodoit / ubuntu: disable dhcp from dnsmasq-base
Created September 21, 2019 18:01 — forked from j-keck/ubuntu: disable dhcp from dnsmasq-base
how to disable dhcp server (dnsmasq-base) on ubuntu
dnsmasq from package 'dnsmasq-base' starts with a (from libvirt) generated configuration: /var/lib/libvirt/dnsmasq/default.conf.
this configuration file is not directly editable because it gets overwritten from libvirt.
there is no possibility to set 'no-dhcp-interface=eth0' per 'libvirt'.
# ###########################################################
# deactivate dhcp in dnsmasq per libvirt
# dnsmasq listen on port 53 (dns) and 67 (dhcp)
j@ubuntu:~$ sudo netstat -taupen | grep -E ':53|:67'
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 0 9817 1218/dnsmasq
@lcuevastodoit
lcuevastodoit / gist:196d5b9800246b7dce8710f4916e6567
Created July 18, 2020 17:19 — forked from adilsoncarvalho/gist:1061938
How to install RSpec to your ruby gems
#
# if you are using RVM installed system wide (root)
# REMEMBER: if you are using RVM system wide NEVER run sudo gem install !!!!
#
rvmsudo gem install rspec rspec-rails rspec-rails-matchers
#
# if you are using RVM only on your local user or not using RVM at all
#
@lcuevastodoit
lcuevastodoit / RAILS_CHEATSHEET.md
Created August 3, 2020 21:47 — forked from crismablanco/RAILS_CHEATSHEET.md
Ruby on Rails Cheatsheet

Ruby on Rails Cheatsheet

Architecture

Create a new application

Install the Rails gem if you haven't done so before

@lcuevastodoit
lcuevastodoit / puma.rb
Created August 7, 2020 00:14 — forked from danielalvarenga/puma.rb
Puma config for rails 5 api
# Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers: a minimum and maximum.
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum; this matches the default thread size of Active Record.
# More: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#threads
#
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
threads threads_count, threads_count
@lcuevastodoit
lcuevastodoit / Rakefile
Created August 8, 2020 12:34 — forked from glava/Rakefile
Stop, Start, Restart Rake tasks for Rails
desc 'Stop rails server'
task :stop do
 File.new("tmp/pids/server.pid").tap { |f| Process.kill 9, f.read.to_i }.delete
end
desc 'Starts rails server'
task :start do
Process.exec("rails s puma -d")
end
@lcuevastodoit
lcuevastodoit / auto_git_file.md
Created August 27, 2020 02:16 — forked from darencard/auto_git_file.md
Automatic file git commit/push upon change

Automatically push an updated file whenever it is changed

Linux

  1. Make sure inotify-tools is installed (https://github.com/rvoicilas/inotify-tools)
  2. Configure git as usual
  3. Clone the git repository of interest from github and, if necessary, add file you want to monitor
  4. Allow username/password to be cached so you aren't asked everytime
git config credential.helper store
@lcuevastodoit
lcuevastodoit / gist:db479a2ad6ddb01e4688c0645d54b65d
Created October 16, 2020 03:38 — forked from tayvano/gist:6e2d456a9897f55025e25035478a3a50
complete list of ffmpeg flags / commands
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)
@lcuevastodoit
lcuevastodoit / Public_Time_Servers.md
Created November 21, 2020 15:29 — forked from mutin-sa/Top_Public_Time_Servers.md
List of Top Public Time Servers

Google Public NTP [AS15169]:

time.google.com

time1.google.com

time2.google.com

time3.google.com

@lcuevastodoit
lcuevastodoit / qemu-networking.md
Created December 12, 2020 14:04 — forked from extremecoders-re/qemu-networking.md
Setting up Qemu with a tap interface

Setting up Qemu with a tap interface

There are two parts to networking within QEMU:

  • The virtual network device that is provided to the guest (e.g. a PCI network card).
  • The network backend that interacts with the emulated NIC (e.g. puts packets onto the host's network).

Example: User mode network

@lcuevastodoit
lcuevastodoit / make-chr.sh
Created December 12, 2020 15:05 — forked from stroebs/make-chr.sh
Install Mikrotik CHR on a Digital Ocean droplet (Ubuntu 16.04.6 tested working 31/08/2019)
#!/bin/bash
#
# Digital Ocean Ubuntu 16.04.6 Droplet
# Running:
# wget https://gist.githubusercontent.com/stroebs/54fc09734a3911e91eeeb43434f117df/raw/1ede2fb162d404171122db0c84a9eeea468a92cd/make-chr.sh
# chmod +x make-chr.sh
# ./make-chr.sh
#
wget http://download2.mikrotik.com/routeros/6.37/chr-6.37.img.zip -O chr.img.zip && \
gunzip -c chr.img.zip > chr.img && \