Skip to content

Instantly share code, notes, and snippets.

View marquesds's full-sized avatar
🤖
about:robots

Lucas Marques marquesds

🤖
about:robots
View GitHub Profile
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
int main(){
char *buffer = NULL;
char palavra;
printf("Alocando memoria\n");
@marquesds
marquesds / new_user.sh
Last active September 25, 2017 02:47
Create a new user on Linux (Ubuntu)
# Ref.: https://lucasmarques.me/create-ubuntu-user/
# Add an user lucas and its home folder at /home/lucas
sudo useradd -d /home/lucas -m lucas
# Add a password for user lucas
sudo passwd lucas
# Make bash as default terminal
sudo usermod -s /bin/bash lucas
# Add lucas to sudoers group
sudo adduser lucas sudo
class Rundeck():
def __init__(self, api_token, url='http://127.0.0.1', port=4440):
logging.basicConfig(format='%(asctime)s %(message)s', level=logging.DEBUG)
self.logger = logging.getLogger(__name__)
self.api_token = api_token
self.url = url
self.port = port
def listProjects(self):
""" API call to get the list of the existing projects on the server. """
@marquesds
marquesds / bypass_suds.py
Last active September 25, 2017 02:45
Bypass SSL Python Suds
"""
Ref.: https://lucasmarques.me/bypass-ssl/
"""
# Before instantiate suds client
import ssl
try:
_create_unverified_https_context = ssl._create_unverified_context
except AttributeError:
@marquesds
marquesds / bypass_zeep.py
Last active June 12, 2019 17:54
Bypass SSL Python Zeep
"""
Ref.: https://lucasmarques.me/bypass-ssl/
"""
from requests import Session
from zeep.transports import Transport
from zeep import Client
session = Session()
session.verify = False
@marquesds
marquesds / flush_memcached.sh
Created September 14, 2017 14:18
Flush local memcached
telnet 127.0.0.1 11211
flush_all
quit
def shapeArea(n):
if n == 1:
return n
return shapeArea(n - 1) + 4 * (n - 1)
def shapeArea(n):
result = 0
while n > 1:
result += 4 * (n - 1)
n -= 1
return result + 1
def hello():
ola()
print("Hello!")
def ola():
hola()
print("Olá!")
import sys
RECURSION_LIMIT = 5500000
# Não faça isso em prod :)
sys.setrecursionlimit(RECURSION_LIMIT)