Instantly share code, notes, and snippets.

View gif-from-tweet.md

gif-from-tweet

There are so many great GIFs out there and I want to have copies of them. Twitter makes that harder than it should be by converting them to MP4 and not providing access to the source material. To make it easier, I made a bash pipeline that takes a tweet URL and a filename, extracts the MP4 from that tweet and uses ffmpeg to convert back to GIF.

Dependencies

  • ffmpeg
    • macOS: brew install ffmpeg
    • Ubuntu/Debian: apt install ffmpeg
View cg-container-networking.markdown

Tech talk lite: cloud.gov container networking

       _                 _
      | |               | |
   ___| | ___  _   _  __| |  __ _  _____   __
  / __| |/ _ \| | | |/ _` | / _` |/ _ \ \ / /
 | (__| | (_) | |_| | (_| || (_| | (_) \ V /
  \___|_|\___/ \__,_|\__,_(_)__, |\___/ \_/
                             __/ |
                            |___/
View tiny_letter_mod.php
<form action="http://tinyletter.com/mohdhuzairy" method="post" target="popupwindow" onsubmit="window.open('http://tinyletter.com/mohdhuzairy', 'popupwindow', 'scrollbars=yes,width=800,height=600');return true"><p><input type="text" name="emailaddress" value="Masukkan emel anda" onfocus="if (this.value == 'Masukkan emel anda') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Masukkan emel anda';}" /></p><input type="hidden" value="1" name="embed"/><input type="submit" value="Subscribe" /><p>Powered by <a href="http://tinyletter.com"> TinyLetter</a></p></form>
View .cgrc.sh
# The Concourse commands here assume that you target your Concourse
# instance with the `fr` name. Modify anything matchin `-t fr` as
# necessary.
# Search through cf-cli commands using an alias
# @usage: wtcf bind
searchCf() {
cf help -a | grep $@
View tock-ssp-diagram.mmd
%% Tock SSP Diagram
graph TB
subgraph cloud.gov
subgraph Private subnet Database Tier
db["<center>PostgresSQL<br/>(CF Marketplace)</center>"]
logs["<center>Elasticsearch<br/>(CF Marketplace)</center>"]
end
View g-devops-presents-workflows-and-separation-of-responsibilities-for-circleci.markdown

#g-devops Presents: Workflows and Separations of Responsibilities for CircleCI

To increase the speed of your software development through faster feedback, shorter reruns, and more efficient use of resources, configure Workflows.

  • CircleCI version 2.0 documentation on Orchestrating Workflows

Disclaimer This talk is about making sure we’re using CircleCI version 2.0 the way it is used at 18F and blessed by the #g-devops folks. Office/Working hours are weekly at 4pm EST on Tuesdays. The next meeting is March 6th, 2018.

View instructions.md

Getting an interactive Django console from within a CF python-buildpack

  1. cf ssh into a running application
    • Once in your running application, find the dependencies that were used for running your Python application. They should be in a directory marked deps/.
  2. Export the $LD_LIBRARY_PATH to include the lib/ directory found in the deps/ directory. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/vcap/deps/0/lib.
  3. Change directories into your Django app and run python manage.py shell
View using-gpg-instead-of-fugacious.md

Using GPG to encrypt messages now that Fugacious is Toast

           _               _____ ______ _____   _                                           _
          (_)             |  __ \| ___ \  __ \ | |                                         | |
 _   _ ___ _ _ __   __ _  | |  \/| |_/ / |  \/ | |_ ___     ___ _ __   ___ _ __ _   _ _ __ | |_
| | | / __| | '_ \ / _` | | | __ |  __/| | __  | __/ _ \   / _ \ '_ \ / __| '__| | | | '_ \| __|
| |_| \__ \ | | | | (_| | | |_\ \| |   | |_\ \ | || (_) | |  __/ | | | (__| |  | |_| | |_) | |_
 \__,_|___/_|_| |_|\__, |  \____/\_|    \____/  \__\___/   \___|_| |_|\___|_|   \__, | .__/ \__|
                    __/ |                                                        __/ | |
                   |___/                                                        |___/|_|
View building-a-time-tracking-tool-in-rust.markdown

Building a time-tracking tool in Rust

 _____     _ _   _ _
| __  |_ _|_| |_| |_|___ ___    ___
| __ -| | | | | . | |   | . |  | .'|
|_____|___|_|_|___|_|_|_|_  |  |__,|
 _   _               _  |___|        _
| |_|_|_____ ___ ___| |_ ___ ___ ___|_|___ ___
|  _| |     | -_|___| '_| -_| -_| . | |   | . |
|_| |_|_|_|_|___|   |_,_|___|___|  _|_|_|_|_  |
View create_ram_disk_macos.sh
#!/bin/bash
ramfs_size_mb=1024
mount_point=~/volatile
ramfs_size_sectors=$((${ramfs_size_mb}*1024*1024/512))
ramdisk_dev=`hdid -nomount ram://${ramfs_size_sectors}`
newfs_hfs -v 'Volatile' ${ramdisk_dev}
mkdir -p ${mount_point}
mount -o noatime -t hfs ${ramdisk_dev} ${mount_point}