Skip to content

Instantly share code, notes, and snippets.

@pragnesh
pragnesh / csv_splitter.py
Created August 16, 2022 07:54 — forked from jrivero/csv_splitter.py
A Python CSV splitter
import os
def split(filehandler, delimiter=',', row_limit=10000,
output_name_template='output_%s.csv', output_path='.', keep_headers=True):
"""
Splits a CSV file into multiple pieces.
A quick bastardization of the Python CSV library.
Arguments:
@pragnesh
pragnesh / redis-mass-insert.md
Created November 2, 2021 06:35 — forked from Squab/redis-mass-insert.md
Prepares data for Redis Mass Insertion with the redis-cli --pipe command

redis-mass-insertion

Lightweight Python script to prepare Redis commands for mass insertion.

Code

#!/usr/bin/env python
"""
    redis-mass.py
@pragnesh
pragnesh / mirror_remote_directory_to_local_directory
Created November 2, 2021 04:21 — forked from pixeline/mirror_remote_directory_to_local_directory
Bash script using lftp to mirror remote directory to local directory, thus keeping the local directory synchronized with the remote one.
#!/bin/sh
# @author: Alexandre Plennevaux
# @description: MIRROR DISTANT FOLDER TO LOCAL FOLDER VIA FTP
#
# FTP LOGIN
HOST='sftp://ftp.domain.com'
USER='ftpusername'
PASSWORD='ftppassword'
# DISTANT DIRECTORY
@pragnesh
pragnesh / codecommit and ec2 role.md
Created November 3, 2020 06:23 — forked from ddepaoli3/codecommit and ec2 role.md
How to use codecommit with IAM role without using IAM user credential
@pragnesh
pragnesh / sysctl.conf
Created November 22, 2018 04:32 — forked from voluntas/sysctl.conf
Sysctl configuration for high performance
### KERNEL TUNING ###
# Increase size of file handles and inode cache
fs.file-max = 2097152
# Do less swapping
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
cd ~
curl -O https://www.amazontrust.com/repository/AmazonRootCA1.pem;mv AmazonRootCA1.pem AmazonRootCA1.crt
curl -O https://www.amazontrust.com/repository/AmazonRootCA2.pem;mv AmazonRootCA2.pem AmazonRootCA2.crt
curl -O https://www.amazontrust.com/repository/AmazonRootCA3.pem;mv AmazonRootCA3.pem AmazonRootCA3.crt
curl -O https://www.amazontrust.com/repository/AmazonRootCA4.pem;mv AmazonRootCA4.pem AmazonRootCA4.crt
cd /usr/local/share/ca-certificates/
sudo mv ~/AmazonRootCA*.crt .
sudo update-ca-certificates
ls
# Driver plugin installation
Minikube uses Docker Machine to manage the Kubernetes VM so it benefits from the
driver plugin architecture that Docker Machine uses to provide a consistent way to
manage various VM providers. Minikube embeds VirtualBox and VMware Fusion drivers
so there are no additional steps to use them. However, other drivers require an
extra binary to be present in the host PATH.
The following drivers currently require driver plugin binaries to be present in
the host PATH:
@pragnesh
pragnesh / NASA_images_png2yuv
Created December 12, 2017 06:02 — forked from jesstess/NASA_images_png2yuv
Turning NASA images into movies: png2yuv | mpeg2enc
Keith gave me the hook-up on turning NASA images into a high-quality movie. I had tried twiddling knobs starting from a basic ffmpeg incant:
ffmpeg -r 10 -i frame%03d.jpg frames.mov
but the movies looked terrible.
Keith said:
"""
Generally if you're making a movie out of separate frames, I prefer to use png2yuv and mpeg2enc from the mjpegtools package instead of ffmpeg -- it's pretty clean code designed for this task instead of an assemblage of random libraries.
;;;;;;;;;;;;;;;;;;;;;
; FPM Configuration ;
;;;;;;;;;;;;;;;;;;;;;
; All relative paths in this configuration file are relative to PHP's install
; prefix (/usr). This prefix can be dynamically changed by using the
; '-p' argument from the command line.
; Include one or more files. If glob(3) exists, it is used to include a bunch of
; files from a glob(3) pattern. This directive can be used everywhere in the