Skip to content

Instantly share code, notes, and snippets.

@arifwn
arifwn / verify.sh
Created May 23, 2024 06:37
verify wordpress files
wp core verify-checksums --skip-plugins --skip-themes
wp plugin verify-checksums --all --skip-plugins --skip-themes
@arifwn
arifwn / find-recently-update-files.sh
Last active May 23, 2024 06:20
find recently updated files
find /path/to/directory -type f -exec stat --format '%Y :%y %n' "{}" \; | sort -nr | cut -d: -f2- | head
find /path/to/directory -type f -exec stat --format '%Y :%y %n' "{}" \; | sort -nr | cut -d: -f2- > .recently-modified-files.log
@arifwn
arifwn / release-camera.sh
Created June 3, 2021 08:25
Release Webcam on MacOS
#!/bin/sh
# sometimes an app will fails to acquire camera for some unknown reason.
# this will release the camera from whatever hogging them in the first place
sudo killall VDCAssistant
sudo killall AppleCameraAssistant
@arifwn
arifwn / Dockerfile
Last active December 23, 2024 05:57
(Relatively) Simple Dockerfile that bundles Django, Nginx, Gunicorn, Supervisord, Celery, Redis, Memcached, wkhtmltopdf, nodejs and React frontend build in a single container
FROM python:3.8
ENV PYTHONUNBUFFERED 1
# Install node prereqs, nodejs and yarn
# Ref: https://deb.nodesource.com/setup_10.x
# Ref: https://yarnpkg.com/en/docs/install
RUN \
apt-get update && \
apt-get install -yqq apt-transport-https xfonts-base xfonts-75dpi libsasl2-dev
RUN \
@arifwn
arifwn / site-name.conf
Created February 8, 2017 21:19
Handle CORS OPTIONS in Nginx
# inside location block
if ($request_method = OPTIONS ) {
add_header Access-Control-Allow-Origin "$http_origin";
add_header Access-Control-Allow-Methods "GET, OPTIONS";
add_header Access-Control-Allow-Headers "Authorization";
add_header Access-Control-Allow-Credentials "true";
add_header Content-Length 0;
add_header Content-Type text/plain;
return 200;