Skip to content

Instantly share code, notes, and snippets.

View cosmincatalin's full-sized avatar
👻

Cosmin Catalin SANDA cosmincatalin

👻
View GitHub Profile
@cbzehner
cbzehner / Cargo.toml
Last active September 20, 2023 08:27
Prompt for missing values in Clap
[package]
name = "clap_prompt_example"
version = "0.1.0"
edition = "2021"
[dependencies]
clap = { version = "3.1", features = ["derive"] }
dialoguer = "0.10"
@skipperkongen
skipperkongen / scrape-image.py
Last active February 7, 2019 13:35
Scrape images from the Google Images
# pip install icrawler
from icrawler.builtin import GoogleImageCrawler
import argparse
if __name__=='__main__':
parser = argparse.ArgumentParser(description='Scrape some images.')
parser.add_argument('keywords', metavar = 'KEYWORDS', nargs = '+',
help='keywords to download images for')
parser.add_argument('-n', '--max-num', type = int, default = 10,
@sandipchitale
sandipchitale / rewritehistory-main.sh
Last active October 1, 2023 22:25
Collapse all history of git repo. #git
git checkout --orphan onetime
git add -A
git commit -m "Initial commit"
git branch -D main
git branch -m main
git gc --aggressive --prune=all
git push -f origin main
@flovv
flovv / DeepLearningPartOne.R
Created June 18, 2017 16:02
Deep Learning for Brand Logo detection in R
########## data proprocessing!
## download the file set from here: http://image.ntua.gr/iva/datasets/flickr_logos/
## extract image to a folder flickrData
### copy files in the right directories
options(stringsAsFactors = F)
df <- read.csv("flickrData/flickr_logos_27_dataset_query_set_annotation.txt", sep="\t")
@nicor88
nicor88 / bootstrap_jupyter.sh
Created April 20, 2017 10:23
Bootstrap action to install Conda and Jupyter on EMR
#!/usr/bin/env bash
set -x -e
JUPYTER_PASSWORD=${1:-"myJupyterPassword"}
NOTEBOOK_DIR=${2:-"s3://myS3Bucket/notebooks/"}
# home backup
if [ ! -d /mnt/home_backup ]; then
sudo mkdir /mnt/home_backup
sudo cp -a /home/* /mnt/home_backup
@mrchristine
mrchristine / aws_assign_eip.sh
Created September 6, 2016 18:19
Assign an elastic ip with a bootstrap script.
#/bin/bash
# Set Params
k=YOUR_AWS_KEYS
s=YOU_AWS_SECRETE
r=YOUR_REGION
# Assign EIP ID
eip_id=eipalloc-XXXXXXX
# Install awscli
@yyolk
yyolk / install.sh
Last active October 14, 2016 10:54
Install RabbitMQ on Amazon linux, along with Erlang
# Modify /etc/yum.repos.d/epel.repo. Under the section marked [epel], change enabled=0 to enabled=1.
sudo yum install erlang --enablerepo=epel
wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.1.1/rabbitmq-server-3.1.1-1.noarch.rpm
sudo rpm -Uvh rabbitmq-server-3.1.1-1.noarch.rpm
# Enable managament plugin
sudo rabbitmq-plugins enable rabbitmq_management
@four43
four43 / redis-server
Created March 12, 2015 13:53
Redis Server - Init Script
#!/bin/sh
# From - http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# - https://github.com/saxenap/install-redis-amazon-linux-centos/blob/master/redis-server
#
# redis - this script starts and stops the redis-server daemon
# Originally from - https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
#
# chkconfig: - 85 15
# description: Redis is a persistent key-value database
# processname: redis-server
@jonschoning
jonschoning / pc.laptop
Last active October 10, 2022 11:33
/usr/share/X11/xkb/symbols/pc (swap CTRL+ALT+CAPS; ALT->CTRL, CAPS->ALT) https://github.com/jonschoning/xkb_symbols
default partial alphanumeric_keys modifier_keys
xkb_symbols "pc105" {
key <ESC> { [ Escape ] };
// The extra key on many European keyboards:
key <LSGT> { [ less, greater, bar, brokenbar ] };
// The following keys are common to all layouts.
key <BKSL> { [ backslash, bar ] };
@tmcgrath
tmcgrath / Spark aggregateByKey
Created December 2, 2014 14:41
Spark aggregateByKey example
Welcome to
____ __
/ __/__ ___ _____/ /__
_\ \/ _ \/ _ `/ __/ '_/
/___/ .__/\_,_/_/ /_/\_\ version 1.1.0
/_/
Using Scala version 2.10.4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_65)
Type in expressions to have them evaluated.
Type :help for more information.