Skip to content

Instantly share code, notes, and snippets.

@pcolazurdo
pcolazurdo / readme.MD
Last active November 23, 2023 21:20
Home Raspberry PI setup
@pcolazurdo
pcolazurdo / needs_restart.sh
Created June 23, 2020 13:18
Check if restart is needed in Amazon Linux
needs-restarting -r ; echo $?
# Core libraries or services have been updated:
# openssl-libs -> 1:1.0.1e-60.el7_3.1
# systemd -> 219-30.el7_3.9
# Reboot is required to ensure that your system benefits from these updates.
# More information:
# https://access.redhat.com/solutions/27943
# 1
@pcolazurdo
pcolazurdo / john_hopkins_dataset_analysis.ipynb
Last active April 21, 2020 18:56
Jupyter Notebook to investigate COVID-19 Statistics
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pcolazurdo
pcolazurdo / README.md
Last active April 13, 2020 14:14
Some tricks to improve the shell
  1. Install brew
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    brew update
    
  2. Install iterm2
    brew cask install iterm2
    
  3. Instal oh-my-zsh
@pcolazurdo
pcolazurdo / README.md
Last active February 19, 2021 00:02
Doing some tweet Analysis from a tweet backup

Tweet Analysis

Prerequisite

  1. Setup an ENV variable called TWITTER_DATA pointing to where you extracted your twitter.zip content
cat tweet.json | jq . | grep expanded_url | grep -v twitter.com | cut -d\" -f4 | sort | uniq -c | wc -l
@pcolazurdo
pcolazurdo / README.md
Created March 17, 2020 12:58
Setting WiFi Access on Respbian Jessie
@pcolazurdo
pcolazurdo / transcribe.sh
Last active March 16, 2020 19:16
AWS Transcribe sample
YT_FILE=poX6BEzVmdE
BUCKET_NAME="Please define the Bucket where the output will be sent - you can also use paths if needed"
FILE_OUTPUT=`youtube-dl -o '%(id)s.%(ext)s' --restrict-filenames https://www.youtube.com/watch\?v\=${YT_FILE} | grep "[download] Destination:" | cut -d: -f1`
aws s3 cp ${FILE_OUTPUT} s3://${BUCKET_NAME}/${YT_FILE}
aws transcribe start-transcription-job --transcription-job-name ${YT_FILE} --language-code en-GB --media MediaFileUri=s3://${BUCKET_NAME}/${YT_FILE} --output-bucket-name ${BUCKET_NAME}
sleep 120 #or use list-transcript-jobs until it is completed
@pcolazurdo
pcolazurdo / cloud9_setup.sh
Last active April 9, 2024 09:58
Installing basic development extensions on cloud9
# Install HomeBrew
# BEGIN Fix touch while this is not closed
[ ! -f /usr/bin/touch ] && sudo ln /bin/touch /usr/bin/touch
# END Fix touch while this is not closed
CI=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv)
test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
test -r ~/.bash_profile && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.bash_profile
echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile
@pcolazurdo
pcolazurdo / resize_cloud9.sh
Last active March 23, 2021 08:52
Resize Cloud9 storage
#!/bin/bash
# Specify the desired volume size in GiB as a command-line argument. If not specified, default to 20 GiB.
SIZE=${1:-20}
# Install the jq command-line JSON processor.
sudo yum -y install jq >/dev/null
# Get the ID of the envrionment host Amazon EC2 instance.
INSTANCEID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)