Skip to content

Instantly share code, notes, and snippets.

View fbarriga's full-sized avatar

Felipe Barriga Richards fbarriga

  • Santiago, Chile
View GitHub Profile
@fbarriga
fbarriga / dlink_firmware_sourcecode.md
Last active November 5, 2023 18:39
Download D-Link Firmware source code
@fbarriga
fbarriga / dump_s3_keys.md
Last active November 5, 2023 17:09
S3: Dump keys from AWS S3 Bucket with pagination using bash

Dump keys from AWS S3 Bucket with pagination

$ export url='https://BUCKET_NAME.s3.amazonaws.com/?list-type=2'
$ function dump_urls { cat data.xml \
  | sed 's/<Contents>/\n/g' \
  | sed -ne 's/.*<Key>\(.*\)<\/Key>.*/\1/p' >> urls.txt; \
  }
$ rm -f urls.txt data.xml
$ curl $url -o data.xml
@fbarriga
fbarriga / README.md
Last active March 19, 2024 11:23
DynamoDB local on M1 Apple Silicon (macos)
  1. download openjdk for macos x86_64

    https://adoptium.net/download

  2. decompress it somewhere (e.g. ~/software/jdk-11.0.15_10)

  3. brew install dynamodb-local

@fbarriga
fbarriga / xlsx_grep
Last active December 15, 2017 20:58
Search inside xlsx files (excel)
#!/usr/bin/env sh
#WIP
if [ $# -ne 2 ]; then
echo "Usage: $0 \"search_string\" file.xlsx"
echo " e.g.: $0 \"foo\" *.xlsx"
exit 1
fi
@fbarriga
fbarriga / frag_check.pl
Created May 21, 2017 05:45
Summary of directory fragmentation
#!/usr/bin/perl -w
# stolen from: https://forums.gentoo.org/viewtopic-p-3089351.html
#this script search for frag on a fs
use strict;
#number of files
my $files = 0;
#number of fragment
my $fragments = 0;
# get the files and amount of extends
find . -type f -exec filefrag '{}' \; > frags.txt
# sort by extends
cat frags.txt | sed 's/\([^:]*\)\: \([0-9]*\) extent[s]* found/\2 \1/g' | sort -n -r > sorted_frags.txt
# defrag the files
cat sorted_frags.txt | cut -d' ' -f2- | xargs -d'\n' -I{} sudo btrfs filesystem defragment -v "{}"
@fbarriga
fbarriga / package.json
Last active September 30, 2020 17:27
NodeJS Development using docker
{
"name": "docker_web_app",
"version": "1.0.0",
"description": "Node.js on Docker",
"author": "First Last <first.last@example.com>",
"main": "server.js",
"scripts": {
"start": "node server.js"
},
"dependencies": {
@fbarriga
fbarriga / Dockerfile
Last active January 20, 2017 20:44
docker dev env for mate using openSuse.
FROM opensuse:tumbleweed
MAINTAINER Felipe Barriga Richards <felipe at felipebarriga.cl>
RUN echo "commit.downloadMode = DownloadInAdvance" >> /etc/zypp/zypp.conf && \
zypper --non-interactive update && \
zypper --non-interactive install sudo xorg-x11-server-extra xterm x11vnc xvfb-run iproute2 twm && \
zypper --non-interactive install git nano man && \
zypper --non-interactive install -t pattern devel_C_C++ && \
zypper --non-interactive addrepo --no-gpgcheck http://download.opensuse.org/repositories/X11:/MATE:/Next/openSUSE_Factory/ mate:next
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
mQENBFRovA8BCACnylHul2R6j9XaHaaS2GedY89AZ3dhFEbelP2o8S8WLvDsk/6w
UFMB66fATbQ/fXG7cL7Rni1jV8vCSz7e6X1jtzn/XoW79IC+PsnOgoCspeaGGB1J
ggeZTOwzSlDbXZVAlK5guGpqr95ojLVfVjL1mbnH8Ejg9nZofNLEbVTBhlTyA8QE
ZIn9omupLDktLqVUyCBTdDE4EHEc8ytKJJYVlmQgUlItr5vEEYYn5GY6nj3Fq2cI
R+R4aOiV7hKoSD9CmMzviw3a7Njr2lmhO30+0ap2ZxbjwAJNKEA1AiR+nehjjs6F
owrn2Uh7aeY0GkUBC7IFmHnnONTkwPFRuTEjABEBAAG0MUZlbGlwZSBCYXJyaWdh
IFJpY2hhcmRzIDxmZWxpcGVAZmVsaXBlYmFycmlnYS5jbD6JATkEEwECACMFAlRo

Keybase proof

I hereby claim:

  • I am fbarriga on github.
  • I am fbarriga (https://keybase.io/fbarriga) on keybase.
  • I have a public key whose fingerprint is F8C4 34E2 D795 53C5 23AE 308C 3AC6 391E 63CF 1A37

To claim this, I am signing this object: