Skip to content

Instantly share code, notes, and snippets.

Átila Camurça Alves atilacamurca

Block or report user

Report or block atilacamurca

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@atilacamurca
atilacamurca / _service.md
Created Apr 17, 2017 — forked from naholyr/_service.md
Sample /etc/init.d script
View _service.md

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
View gist:cf3fdb9d1cf0eb53c3e27cabf022a91a
$(document).ready(function() {
// add a hash to the URL when the user clicks on a tab
$('a[data-toggle="tab"]').on('click', function(e) {
history.pushState(null, null, $(this).attr('href'));
});
// navigate to a tab when the history changes
window.addEventListener("popstate", function(e) {
var activeTab = $('[href="' + location.hash + '"]');
if (activeTab.length) {
activeTab.tab('show');
@atilacamurca
atilacamurca / SlideShare.php
Created Dec 1, 2014
zf1 - workaround for slideshare api 2.0 support in zf1 - just replace the method _slideShowNodeToObject
View SlideShare.php
<?php
class Zend_Service_SlideShare
{
/**
* Converts a SimpleXMLElement object representing a response from the service
* into a Zend_Service_SlideShare_SlideShow object
*
* @param SimpleXMLElement $node The input XML from the slideshare.net service
* @return Zend_Service_SlideShare_SlideShow The resulting object
@atilacamurca
atilacamurca / haertblaad.py
Created Jul 9, 2014
desafio 4 - script para gerar arquivo com letras trocadas.
View haertblaad.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
if __name__ == '__main__':
file = open("heartbleed.txt")
lines = ""
for line in file:
aux = list(line)
for i in range(len(aux)):
if aux[i] == "a":
@atilacamurca
atilacamurca / dica-02.hex
Last active Aug 29, 2015
desafio-hacker-comsolid7
View dica-02.hex
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gYdABEHBG4brgAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAlWSURBVHja7d0hS2txHMfhs+uCIL4Ai2AwGCwKKgwUbAPbgiIIwhA0iAbLQNPAZrGIWOaKZSBYDILLFhEGgt20gZpWva/gXn7jnqPX7XnyFzn+9cCHfzm5JEk+EwAABsYvRwAAIAABABCAAAAIQAAABCAAAAIQAAABCACAAAQAQAACACAAAQAQgAAACEAAAAQgAAACEABAAAIAIAABABCAAAAIQAAABCAAAAIQAAABCACAAAQAQAACACAAAQAQgAAACEAAAAQgAAACEABAAAIAIAABABCAAAAIQAAABCAAAAIQAAABCACAAAQAQAACACAAAQAQgAAACEAAAAQgAIAABABAAAIAIAABABCAAAAIQAAABCAAAAIQAAABCACAAAQAQAACACAAAQAQgAAACEAAAAQgAIAABABAAAIAIAABABCAAAAIQAAABCAAAAIQAAABCACAAAQAQAACACAAAQAQgAAACEAAAAEIAIAABABAAAIAIAABABCAAAAIQAAABCAAAAIQAAABCACAAAQAQAACACAAAQAQgAAACEAAAAEIAIAABABAAAIAIAABABCAAAAIQAAABCAAAAIQAAABCACAAAQAQAACABCTdwQAfzcxMRHeFgqF8Pbx8TG8fX5+zuR3W1hYCG/n5ubC21arFd42m80f9f9QKpXC21wuF942Gg0vG1/GDSAAgAAEAEAAAgAgAAEAEIAAAAhAAAAEIAAAAhAAAAEIAIAABAAgDbkkST4dAzBohoaGwtuHh4fwdnZ2Nrw9ODgIb09OTsLb1dXV8Pby8jK8rdVq4e36+np4e3h4GN6enp5m8v+wsb
View gerar-certificados-flisol.md

Baixe o projeto: https://www.dropbox.com/s/ep3t7h12ypkottg/flisol-cert.tar.bz2

  1. extrair
  2. instalar php5 e php5-gd (apt-get install php5 php5-gd)
  3. abre um terminal
  4. entra no diretorio do projeto
  5. você encontrará um arquivo chamado ParticipantesFlisol.ods, esse arquivo deverá conter o nome dos participantes. Abra o arquivo exemplo e veja como ele deve ser montado.
  6. Mude também o modelo do certificado em img/modelo.jpg. Use o mesmo tamanho e formato para melhor qualidade do certificado.
  7. executa ./gerar.sh. Esse script irá converter os dados para CSV e fazer um certificado para cada nome encontrado.
  8. tomar um café, porque vai demorar um pouco, mas dá pra acompanhar o processo na tela :)
@atilacamurca
atilacamurca / SlideShare.php
Created Apr 3, 2014
Trecho referente a classe Zend_Service_SlideShare, houve mudanças na API e alguns nomes das tags do XML estão diferentes.
View SlideShare.php
protected function _slideShowNodeToObject(SimpleXMLElement $node)
{
if($node->getName() == 'Slideshow') {
$ss = new Zend_Service_SlideShare_SlideShow();
$ss->setId((string)$node->ID);
$ss->setDescription((string)$node->Description);
$ss->setEmbedCode((string)$node->Embed); // changed
$ss->setNumViews((string)$node->Views);
@atilacamurca
atilacamurca / Api.java
Created Mar 10, 2014
Cross Site Access via JSONP
View Api.java
public abstract class Api extends HttpServlet {
protected void responder(JSONObject resultado, HttpServletResponse response, String callback) {
try {
response.setContentType("text/javascript;charset=utf-8");
response.setHeader("Access-Control-Allow-Headers", "Content-Type, x-xsrf-token");
PrintWriter out = response.getWriter();
String saida = callback + "(" + resultado + ");";
out.print(saida);
} catch (IOException e) {
@atilacamurca
atilacamurca / questoes.py
Created Nov 26, 2013
algoritmo para escolha de 5 questões aleatórias
View questoes.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
questoes_disponiveis = [1, 2, 3, 4, 5, 6, 7, 8, 9]
questoes_escolhidas = []
i = 0
while i < 5:
rand = random.randrange(len(questoes_disponiveis))
@atilacamurca
atilacamurca / printme.py
Created Apr 18, 2013
print the file itself
View printme.py
import os
if __name__ == '__main__':
os.system("cat %s" % os.path.abspath(__file__))
exit(0)
print "hello world."
You can’t perform that action at this time.