Skip to content

Instantly share code, notes, and snippets.

View vpereira's full-sized avatar

Victor Pereira vpereira

View GitHub Profile
apiVersion: v1
kind: Pod
metadata:
name: busybox
namespace: kubeflow
spec:
restartPolicy: Never
containers:
- name: volume-check
image: busybox
@vpereira
vpereira / gist:8543492
Last active January 4, 2016 00:39
some translations gnutls -> openssl and vice-versa

gnutls NORMAL ciphersuite to openssl

./gnutls NORMAL | ./cipher_translate.rb gnutls_to_openssl


TLS_RSA_AES_128_GCM_SHA256 -> -
TLS_RSA_AES_128_CBC_SHA1 -> -
TLS_RSA_AES_128_CBC_SHA256 -> -
TLS_RSA_AES_256_CBC_SHA1 -> AES256-SHA

TLS_RSA_AES_256_CBC_SHA256 -> -

( 4/33) Installing: python-six-1.4.1-2.1.2 ....................................................................................................[error]
Installation of python-six-1.4.1-2.1.2 failed:
Error: Subprocess failed. Error: RPM failed: error: unpacking of archive failed on file /usr/lib/python2.7/site-packages/six-1.4.1-py2.7.egg-info: cpio: rename failed - Is a directory
@vpereira
vpereira / exploit.rb
Created November 27, 2013 16:51 — forked from jacopen/exploit.rb
require 'yajl'
require 'json'
require 'oj'
def digit_pattern
digit_pattern ||= rand(10000).to_s
end
def integer_part
digit_pattern
@vpereira
vpereira / A.java
Created September 26, 2013 21:04
endianess from scrypt
//data from here https://litecoin.info/Scrypt
import java.io.*;
import java.util.*;
import java.net.*;
import java.security.*;
import java.text.*;
import java.util.zip.*;
public class A {
@vpereira
vpereira / gist:6502201
Created September 9, 2013 22:09
mindstatec Makefile
CC = clang
CFLAGS = -march=native -Wall -funroll-all-loops -O3 -fstrict-aliasing -Wall -std=c99 -I/usr/include/python2.7
LDFLAGS = -Wl, -Wl, -lpython2.7
all: test midstate.so
test: midstatemodule.c
$(CC) $(CFLAGS) midstatemodule.c -o test $(LDFLAGS)
midstate.so: midstatemodule.c
@vpereira
vpereira / iostats.rb
Created November 9, 2012 10:50
simple iostats in ruby
def read_file
File.open('/proc/diskstats').collect do |line|
entries = line.split
next unless entries[2] =~/sda/
[entries[2],entries[4],entries[5]]
end.compact.flatten
end
while true
time_1 = Time.now.to_f
@vpereira
vpereira / petzer.py
Created October 24, 2012 12:35
Petzer.py
#!/usr/bin/env python
# run it as root
# as result you get list pid -> number of fds
import os
for pid in [pid for pid in os.listdir('/proc') if pid.isdigit()]:
print pid,len([name for name in os.listdir(os.path.join('/proc',pid,'fd')) if not os.path.isdir(name)])
# Netscape HTTP Cookie File
# http://www.netscape.com/newsref/std/cookie_spec.html
# This is a generated file! Do not edit.
192.168.1.1 FALSE / FALSE 0 _superapp_session BAh7CkkiD3Nlc3Npb25faWQGOgZFRiIlNWMyOWY5MjE5YmU0MWMzMWM0ZGQxNTdkNzJkOTFmZTRJIhBfY3NyZl90b2tlbgY7AEZJIjF6RStYQzdONGxScUZybWxhbUwwUDI2RWZuai9laWVsS3FKRXhZYnlQUmJjPQY7AEZJIgtsb2NhbGUGOwBGSSIHZW4GOwBGSSIVdXNlcl9jcmVkZW50aWFscwY7AEZJIgGAOThiOGU5ZTcwMDFlOGI4N2IzNjQxMjlkNWYxNGExYzg3NjY5ZjE1ZjFjMDM3MWJiNjg1OGFlOTBlNjQxM2I1Y2JiODlkNTExMjU1MzBhMDk0ZjlmN2JlNjAyZTMzMjYxNzc5OGM2OTg1ZGRlYzgxNmFlZmEzYmRjNDk4YTBjNzcGOwBUSSIYdXNlcl9jcmVkZW50aWFsc19pZAY7AEZpBg%3D%3D--810acaa3759101ed79740e25de31e0c5bad76cdc
class(homens$Valor)
[1] "factor"
as.numeric(as.character(homens$Valor))
[1] 53 51 47 61 19 31 42 36 45 50 44 39 30 24 22 15 12 7 64 59 35 11 56 6 16