Skip to content

Instantly share code, notes, and snippets.

View gipsh's full-sized avatar
💭
Loading......

gipsh gipsh

💭
Loading......
View GitHub Profile
If you want to integrate your dashboard with mercadopago.
Do you need to add `mercadopago` gem to your Gemfile
@gipsh
gipsh / gist:8d25eded61f4a8f7ef26c8ee3ffd6b7f
Created November 18, 2016 16:47
crear certificados afip
1. Primero genero la key
openssl genrsa -out afip-cuit.key 2048
2. Despues genero el CSR
openssl req -new -key afip-cuit.key -sha256 -subj "/C=AR/O=MISA S.A/CN=misa.com/serialNumber=CUIT 301234567890" -out afip-cuit.csr
3. Con esto puedo generar el cert el site de afip.
@gipsh
gipsh / README.MD
Last active May 15, 2017 04:55
Replace or change a key on ec2 instance

AWS doesnt let you change your ec2 instance key from the admin console.

If you need to replace a key for an ec2 instance:

  1. if you already have the key/pub generated, jump to #3.

  2. Create a new key from command line:

ssh-keygen -t rsa -C "my-new-key"
@gipsh
gipsh / sadp_discovery.rb
Created February 22, 2018 17:37
sadp send discovery
require 'socket'
MULTICAST_ADDR = "239.255.255.250"
PORT= 37020
MSG = "<?xml version=\"1.0\" encoding=\"utf-8\"?><Probe><Uuid>13A888A9-F1B1-4020-AE9F-05607682D23B</Uuid><Types>inquiry</Types></Probe>"
begin
socket = UDPSocket.open
socket.setsockopt(Socket::IPPROTO_IP, Socket::IP_TTL, [1].pack('i'))
socket.send(MSG, 0, MULTICAST_ADDR, PORT)
ensure
@gipsh
gipsh / block.rb
Last active March 20, 2018 17:44
blockchain with ruby
require 'digest'
class Block
attr_accessor :hash, :prev_hash, :data, :time
def initialize(data, prev_hash)
@data = data
@prev_hash = prev_hash
@time = Time.now.getutc.to_i
@hash = gen_hash @data,@prev_hash,@time
require_relative './block'
class Blockchain
attr_reader :blocks
def initialize
genesis = Block.new "genesis block", ""
@blocks = [genesis]
end
@gipsh
gipsh / ftp_uplodaer_threaded.rb
Created May 24, 2018 22:18
ftp upload file benchmark test with threads
FTP_HOST = "ftp.pepe.com"
FTP_USER = "coco"
FTP_PASS = "coco"
# create>> dd if=/dev/zero of=output.file bs=1024 count=1024
UPLOAD_FILE = File.new("./output.file")
def upload_file
file_time = Time.now.strftime("%Y%m%d%H%M%S%L")
file_name = "file_#{file_time}-#{Thread.current.object_id}-.xxx"
@gipsh
gipsh / gist:7c825f8039515a2351559eb9fd5de8d5
Created July 10, 2018 16:01
install ida on ubuntu 17.10 and probably others
sudo apt-get install libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5 lib32z1
sudo apt-get install libfontconfig1:i386 libxrender1:i386 libsm6:i386 libfreetype6:i386 libglib2.0-0:i386
sudo apt-get install libxext6:i386
@gipsh
gipsh / hi3518bootfromsd.MD
Last active September 21, 2020 20:03
hi3518 boot uimage from sd with uboot
  1. ctrl-u to enter bootloader

  2. check you SD partition: fatinfo mmc 0:1

  3. load the kernel image into memory: fatload mmc 0:1 0x82000000 uimage

  4. boot the image: bootm 0x82000000

@gipsh
gipsh / Hik-motion.MD
Last active November 5, 2022 13:55
Hikvision GET and SET motion detection

GET MD settings

curl -u admin:xxxxxxx http://192.168.0.10/ISAPI/System/Video/inputs/channels/2/MotionDetection