Skip to content

Instantly share code, notes, and snippets.

View daemondev's full-sized avatar

Richar Muñico Samaniego daemondev

View GitHub Profile
# CentOS-Vault.repo
#
# CentOS Vault holds packages from previous releases within the same CentOS Version
# these are packages obsoleted by the current release and should usually not
# be used in production
#-----------------
[C6.0-base]
name=CentOS-6.0 - Base
baseurl=http://vault.centos.org/6.0/os/$basearch/
@daemondev
daemondev / client.c
Created July 15, 2018 06:12 — forked from MaxySpark/client.c
Socket Programming
/****************** SERVER CODE ****************/
#include <stdio.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <string.h>
#include <arpa/inet.h>
int main(){
int welcomeSocket, newSocket;
@daemondev
daemondev / re_replace.h
Created July 20, 2018 08:57 — forked from tanbro/re_replace.h
str replace and regex replace functions in C language
#ifndef __RE_REPLACE__
#define __RE_REPLACE__
#include <string.h>
#include <regex.h>
#ifdef __cplusplus
extern "C" {
#endif
@daemondev
daemondev / libwebsockets-webserver.c
Created July 23, 2018 11:48 — forked from martinsik/libwebsockets-webserver.c
Simple webserver based on libwebsockets library. Read full description at http://martinsikora.com/libwebsockets-simple-http-server
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <libwebsockets.h>
static int callback_http(struct libwebsocket_context *context,
struct libwebsocket *wsi,
enum libwebsocket_callback_reasons reason, void *user,
@daemondev
daemondev / main.py
Created September 21, 2018 05:04 — forked from tchen/main.py
Tornado JSON request body
# An example tornado request handler that handles both JSON POST request
# bodies and x-www-form-urlencoded POST bodies.
#
# The benefit of JSON request bodies are more complicated and potentially
# nested dict and list data types.
#
# One drawback to JSON request bodies is that arguments can come in
# different types, so handlers will need to perform additional checks.
# With x-www-form-urlencoded fields, all argument values are strings, if
# they exist.
@daemondev
daemondev / install-odoo.sh
Created October 30, 2018 20:24 — forked from yelizariev/install-odoo.sh
install odoo from source. Script is maintained on github now: https://github.com/yelizariev/install-odoo
if [ "$(basename $0)" = "install-odoo.sh" ]; then
echo "don't run install-odoo.sh, because it's not fully automated script. Copy, paste and execute commands from this file manually"
exit 0
fi
#### Detect type of system manager
export SYSTEM=''
pidof systemd && export SYSTEM='systemd'
@daemondev
daemondev / cache_handler.py
Created November 9, 2018 14:37 — forked from rafaelcapucho/cache_handler.py
Speeding up your MongoDB queries with Tornado Mixin
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from hashlib import md5
import datetime
import tornado.web
@daemondev
daemondev / docker-machine-no-tls.sh
Last active December 2, 2018 01:39 — forked from armand1m/docker-machine-no-tls.sh
Create docker-machine without TLS verification
docker-machine create -d virtualbox --engine-opt tlsverify=false node1
eval $(docker-machine env node1)
unset DOCKER_TLS_VERIFY
https://hub.docker.com/_/python/
https://docs.docker.com/machine/reference/create/#specifying-docker-swarm-options-for-the-created-machine
@daemondev
daemondev / multiple_ssh_setting.md
Created December 16, 2018 20:42 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@daemondev
daemondev / infinite.py
Created June 3, 2019 05:49 — forked from categulario/infinite.py
bucle for infinito en python
def inf(i=0, step=1):
#un generador de iteradores infinitos, como el xrange, pero infinito
while True:
yield i
i+=step
for i in inf():
print i