Skip to content

Instantly share code, notes, and snippets.

View plkumar's full-sized avatar
:octocat:

Lakshman Kumar Peethani plkumar

:octocat:
View GitHub Profile
@plkumar
plkumar / ffmpeg.md
Created August 16, 2024 09:09 — forked from liangfu/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

@plkumar
plkumar / letsencrypt_create.sh
Created May 30, 2024 06:50 — forked from ervilis/letsencrypt_create.sh
Script to generate LetsEncrypt certificate
#!/bin/sh
#
# Wrapper script for the letsencrypt client to generate a server certificate in
# manual mode. It uses openssl to generate the key and should not modify the
# server configuration. It can be called off-side, i.e. not on the destination
# server.
#
# usage: letsencrypt_create.sh DOMAIN [DOMAIN...]
set -e
@plkumar
plkumar / ffmpeg_mkv_ops.md
Created May 8, 2024 19:10 — forked from cdeath/ffmpeg_mkv_ops.md
extract stuff from .mkv with ffmpeg

Installation

  1. Spin up an AWS/Azure/GCP machine (Ubuntu - 16.04)
    • ensure you know how to use the web-interface of these IaaS to open ports for an instance
    • open ports 80, 443, 8000, 8888
  2. Follow this link
  3. Create a dir (.jupyterhub) which shall contain jupyterhub specific files
    • mkdir .jupyterhub
    • cd .jupyterhub
    • jupyterhub --generate-config
    • openssl rand -hex 8 > jupyterhub_cookie_secret
@plkumar
plkumar / plotly-01.json
Created October 25, 2023 09:29
sample plotly dataset
{
"data": [
{
"x": [
"USA",
"India",
"Brazil",
"Russia",
"China",
"Mexico",
@plkumar
plkumar / Mac OS X: Open in Visual Studio Code
Created August 16, 2023 17:25 — forked from tonysneed/Mac OS X: Open in Visual Studio Code
Add a command to Finder services in Mac OSX to open a folder in VS Code
- Open Automator
- File -> New -> Service
- Change "Service Receives" to "files or folders" in "Finder"
- Add a "Run Shell Script" action
- Change "Pass input" to "as arguments"
- Paste the following in the shell script box: open -n -b "com.microsoft.VSCode" --args "$*"
- Save it as something like "Open in Visual Studio Code"
@plkumar
plkumar / Form.gs
Created July 17, 2023 16:57 — forked from baymac/Form.gs
App Script to send the response from Google Form to Firebase
function onFormSubmit(e) {
var form = FormApp.openById('1Z65umQSZ2drz3MvTWCWlwP4-ySeoB5D7RvX1LtusnEU');
var formResponses = form.getResponses();
var latestResponse = formResponses.length - 1;
var formResponse = formResponses[latestResponse];
var email = formResponse.getRespondentEmail();
var items = formResponse.getItemResponses();
@plkumar
plkumar / mosquitto.conf
Created June 8, 2022 19:12
Configure & Run Mosquitto MQTT instance on docker.
# Config file for mosquitto
#
# See mosquitto.conf(5) for more information.
#
# Default values are shown, uncomment to change.
#
# Use the # character to indicate a comment, but only if it is the
# very first character on the line.
# =================================================================
@plkumar
plkumar / resize_disk_image.md
Created April 10, 2022 10:42 — forked from joseluisq/resize_disk_image.md
How to resize a qcow2 disk image on Linux

How to resize a qcow2 disk image on Linux

This example takes olddisk.qcow2 and resizes it into newdisk.qcow2, extending one of the guest's partitions to fill the extra space.

1. qcow2 format

1.1. Verify the filesystems of olddisk.qcow2

@plkumar
plkumar / build.sh
Created April 4, 2022 08:33 — forked from bzub/build.sh
IWD/DBUS OCI container build script using pacstrap (Arch Linux)
#!/usr/bin/env sh
set -e
set -x
# Boilerplate setup
alias buildah="sudo buildah"
container="$(buildah from scratch)"
alias run="buildah run ${container}"
alias copy="buildah copy ${container}"
alias add="buildah add ${container}"