Skip to content

Instantly share code, notes, and snippets.

View robwilde's full-sized avatar
🏠
Just keep Coding, keep on Coding...

Robert Wilde robwilde

🏠
Just keep Coding, keep on Coding...
View GitHub Profile
@robwilde
robwilde / test-octane.md
Created April 22, 2023 00:47 — forked from viezel/test-octane.md
Quick Laravel Octane test - UPDATED

Intro

I wanted to quickly take Laravel Octane beta for a spin, as we have been using Swoole for some time and wanted to see how official support performs vs what we have.

Test 2: Forge server

Next test is more real world as we now have a web server and database server within a VPC.

Using Laravel Forge

@robwilde
robwilde / composer.sh
Created November 11, 2021 05:04 — forked from CarsonF/composer.sh
Global Composer Setup
#!/usr/bin/env bash
# As root
# Make config and data dirs
mkdir /etc/composer -p || exit 1
mkdir /var/lib/composer -p
# Set composer home dir to global location
cat << EOF > /etc/profile.d/composer.sh
#!/usr/bin/env bash
@robwilde
robwilde / composerOauthToken.md
Created October 20, 2021 13:35 — forked from dhargitai/composerOauthToken.md
Stop Composer asking for GitHub credentials

Because of GitHub's rate limits on their API it can happen that Composer prompts for authentication asking your username and password so it can go ahead with its work.

If you would prefer not to provide your GitHub credentials to Composer you can manually create a token using the following procedure:

Create an OAuth token on GitHub.

Add it to the configuration running composer config -g github-oauth.github.com <oauthtoken>

Now Composer should install/update without asking for authentication.

@robwilde
robwilde / firefox-developer-edition.md
Created July 15, 2021 23:58 — forked from mahammad/firefox-developer-edition.md
How To install Firefox Developer Edition and create desktop icon for Ubuntu 14.04 LTS

chose other install way

  1. Open Terminal Ctrl+Alt+T Download Firefox Developer Edition tar file

    wget https://download.mozilla.org/?product=firefox-aurora-latest-ssl&os=linux64&lang=en-US

  2. Copy tar file to opt sudo cp -rp firefox-35.0a2.en-US.linux-x86_64.tar.bz2

  3. Open opt folder (cd /opt/) and untar file sudo tar xjf firefox-35.0a2.en-US.linux-x86_64.tar.bz2

Download Udemy course videos using youtube-dl

$ youtube-dl --list-extractors | grep udemy

Steps

  1. Get link to the course to download. e.g. https://www.udemy.com/course-name/
  2. Login into udemy website, save the cookie from Firefox (cookies.txt)[1] export extension. Save it to file cookies.txt

$ youtube-dl https://www.udemy.com/course-name/ --cookies ./cookies.txt > $ youtube-dl -u username -p password -o './videos/%(playlist)s/%(chapter_number)s - %(chapter)s/%(title)s.%(ext)s' https://www.udemy.com/course-name --cookies ./cookies.txt --verbose

/**
* Get Google Page Speed Screenshot
*
* Uses Google's Page Speed API to generate a screenshot of a website.
* Returns the image as a base64 jpeg image tag
*
* Usage Example:
* echo getGooglePageSpeedScreenshot("http://ghost.org", 'class="thumbnail"');
*
*
@robwilde
robwilde / ffmpeg.md
Created May 7, 2021 00:12 — forked from steven2358/ffmpeg.md
FFmpeg cheat sheet

To install Pulse Secure for Ubuntu 20.04, it is a bit complicated since the support isn't great.

First, we'll want to go through the form at https://www.pulsesecure.net/trynow/client-download/. You'll get an email with download links to the latest versions of pulse secure. Download the Linux one with the deb file and then you can install it using dpkg from your downloads folder.

$ cd ~/Downloads
$ sudo dpkg -i ps-pulse-linux-[your-pulse-version]-ubuntu-debian-64-bit-installer.deb
@robwilde
robwilde / Dockerfile-nodejs
Created June 23, 2019 06:48 — forked from dweinstein/Dockerfile-nodejs
Install node modules before copying over your working code so that node_modules are built (and cached) before you change your service code!
# ...
ADD package.json /tmp/package.json
RUN cd /tmp && npm install && \
mkdir -p /opt/app && cp -a /tmp/node_modules /opt/app/
# ...
WORKDIR /opt/app
ADD . /opt/app
@robwilde
robwilde / docker-cleanup-resources.md
Created June 16, 2019 06:29 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm