$ docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator | |
# First we create a little helper function, becase we will potentially have many PaginatedTypes | |
# and we will potentially want to turn many querysets into paginated results: | |
def get_paginator(qs, page_size, page, paginated_type, **kwargs): | |
p = Paginator(qs, page_size) | |
try: | |
page_obj = p.page(page) | |
except PageNotAnInteger: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install it as a yum package instead of throgh pip (will save you from lots of hassle) | |
# first get epel | |
sudo amazon-linux-extras install epel | |
# then install supervisor | |
sudo yum install supervisor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function clean_number($phone_number){ | |
$phone_number = preg_replace('/^0/','234',$phone_number); | |
$phone_number = preg_replace('/^\+/','',$phone_number); | |
return $phone_number; | |
} | |
// This should convert a number like 09023293092 or +2349023293092 to 2349023293092 |
UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker
now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.
Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/
sudo amazon-linux-extras install docker
sudo service docker start
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Automatically compile and install FFMPEG with NVIDIA hardware acceleration on Debian 12 | |
# Includes cuvid, cuda, nvenc, nvdec, and non-free libnpp | |
# Based on: | |
# https://www.tal.org/tutorials/ffmpeg_nvidia_encode | |
# https://developer.nvidia.com/blog/nvidia-ffmpeg-transcoding-guide/ | |
# Abort on error | |
set -e |
OlderNewer