Skip to content

Instantly share code, notes, and snippets.

View lopesivan's full-sized avatar
🚧
Working from home

Mr. Ivan lopesivan

🚧
Working from home
View GitHub Profile
#include <stdio.h>
#include <sqlite3.h>
#include <pthread.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <time.h>
#define MAX_THREADS 100
import sqlite3
import os
from itertools import cycle, product
DB_FILE = "data.sqlite3"
num_rows = 100000000
elements = cycle(product(["name1", "name2", "name3"], [1,2,3]))
conn = sqlite3.connect(DB_FILE)
curs = conn.cursor()
import sqlite3
import os
from itertools import cycle, product
DB_FILE = "data.sqlite3"
num_rows = 100000000
elements = cycle(product(["name1", "name2", "name3"], [1,2,3]))
conn = sqlite3.connect(DB_FILE)
curs = conn.cursor()
@lopesivan
lopesivan / supervisor
Created April 11, 2022 22:46 — forked from danielrmeyer/supervisor
supervisor config to keep a python script running in home directory.
[program:test]
command=/usr/bin/python /home/ubuntu/test.py
directory=/home/ubuntu
autostart=true
autorestart=true
startretries=3
stderr_logfile=/home/ubuntu/test.err.log
stdout_logfile=/home/ubuntu/test.out.log
user=ubuntu
@lopesivan
lopesivan / update_curl.sh
Created May 4, 2020 08:41 — forked from fideloper/update_curl.sh
Update curl on Ubuntu 14.04
#! /usr/bin/env bash
# Install any build dependencies needed for curl
sudo apt-get build-dep curl
# Get latest (as of Feb 25, 2016) libcurl
mkdir ~/curl
cd ~/curl
wget http://curl.haxx.se/download/curl-7.50.2.tar.bz2
tar -xvjf curl-7.50.2.tar.bz2
@lopesivan
lopesivan / update-pulled-images.md
Created November 1, 2019 11:31 — forked from F21/update-pulled-images.md
Update all pulled docker images

Update all pulled docker images

docker images |grep -v REPOSITORY|awk '{printf "%s:%s\n", $1, $2}'|xargs -L1 docker pull

@lopesivan
lopesivan / cleanup-docker.md
Created November 1, 2019 11:30 — forked from F21/cleanup-docker.md
Commands to clean up docker

Remove dangling images

docker images -qf dangling=true | xargs docker rmi

Remove dangling volumes

docker volume ls -qf dangling=true | xargs -r docker volume rm
@lopesivan
lopesivan / gstreamer-module-build-cluster.md
Created September 13, 2019 23:49 — forked from Brainiarc7/gstreamer-module-build-cluster.md
Guide: How to build gstreamer from source on Ubuntu 16.04 for loading via the modules system

Build gstreamer from source (git checkouts):

Install build dependencies:

sudo apt-get install gtk-doc-tools liborc-0.4-0 liborc-0.4-dev libvorbis-dev libcdparanoia-dev libcdparanoia0 cdparanoia libvisual-0.4-0 libvisual-0.4-dev libvisual-0.4-plugins libvisual-projectm vorbis-tools vorbisgain libopus-dev libopus-doc libopus0 libopusfile-dev libopusfile0 libtheora-bin libtheora-dev libtheora-doc libvpx-dev libvpx-doc libvpx3 libqt5gstreamer-1.0-0 libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libflac++-dev libavc1394-dev libraw1394-dev libraw1394-tools libraw1394-doc libraw1394-tools libtag1-dev libtagc0-dev libwavpack-dev wavpack

Extras:

@lopesivan
lopesivan / Dockerfile
Created December 7, 2018 10:26 — forked from twlz0ne/Dockerfile
Debian 9 Docker image with Clang 6 installed.
FROM launcher.gcr.io/google/debian9:latest
RUN apt-get update && apt-get install -y gnupg wget software-properties-common
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
RUN apt-add-repository "deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-6.0 main"
RUN apt-get update && apt-get install -y clang-6.0
RUN apt-get -y install libclang-common-6.0-dev libclang-6.0-dev libclang1-6.0 libllvm6.0 llvm-6.0-dev
## ISSUE:
# CMake Error at /usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:138 (message):
@lopesivan
lopesivan / url-decoder.py
Created October 30, 2018 08:10 — forked from narate/url-decoder.py
URL decoder command line toots written in Python
#!/usr/bin/env python
'''
Usage :
$ echo encoded_url | python url-decoder.py
'''
import sys
import urllib
data = sys.stdin.read()