Skip to content

Instantly share code, notes, and snippets.

@xacnio
xacnio / telegram_video_sticker_ffmpeg.md
Last active July 13, 2023 10:21
Telegram - Create Video Sticker (.WEBM) with FFMPEG
View telegram_video_sticker_ffmpeg.md

Command

ffmpeg -y -i animated_sticker.mov -r 30 -t 2.99 -an -c:v libvpx-vp9 -pix_fmt yuva420p -s 512x512 -b:v 400K output.webm
  • If .webm file size greater than 256 KB, you should reduce "-b:v 400K"
  • .mov video file may has alpha channel but not required.
  • My video sticker pack for example: https://t.me/addstickers/msn_animations

Telegram Sticker Command

@digilink
digilink / container_deploy.yml
Created July 8, 2021 23:01
Ansible Proxmox LXC deploy
View container_deploy.yml
---
- name: Proxmox lxc provision
hosts: pxsrv01
tasks:
- name: Create new container
proxmox:
vmid: '{{ vmid }}'
api_user: root@pam
api_token_id: root-ansible-token
@emmanuelkehinde
emmanuelkehinde / DropdownSelector.swift
Created May 9, 2021 11:57
Reusable Dropdown selector using SwiftUI
View DropdownSelector.swift
import SwiftUI
struct DropdownOption: Hashable {
let key: String
let value: String
public static func == (lhs: DropdownOption, rhs: DropdownOption) -> Bool {
return lhs.key == rhs.key
}
}
View Calendar.swift
//Orginal code from: https://gist.github.com/mecid/f8859ea4bdbd02cf5d440d58e936faec
//I just made some modification in appearnce, show monthly navigator and weekdays.
import SwiftUI
struct ContentView: View {
@Environment(\.calendar) var calendar
private var year: DateInterval {
calendar.dateInterval(of: .month, for: Date())!
@zonca
zonca / concat_mp4.sh
Last active May 9, 2023 06:39
FFMPEG scripts to speedup and concatenate videos, useful for prerecording videos for conferences
View concat_mp4.sh
ffmpeg -safe 0 -f concat -i <(find . -type f -name '*.mp4' -printf "file '$PWD/%p'\n" | sort) -c copy output.mp4
@mikestecker
mikestecker / optimising-unifi-performance.md
Last active July 18, 2023 00:30
optimising-unifi-performance
View optimising-unifi-performance.md
@Webreaper
Webreaper / docker-compose.yml
Last active September 26, 2023 00:42
Sample Docker-compose file which shows how to set up Sonarr, Radarr, Prowlarr, Lidarr, QBittorrent and a VPN container so that all all traffic from the containers is routed through the VPN. Also includes Plex and get_iplayer containers, which are not routed through the VPN.
View docker-compose.yml
# Docker compose to set up containers for all services you need:
# VPN
# Sonarr, Radarr, Lidarr, Qbittorrent
# Non-VPN
# Plex, get_iplayer
# Before running docker-compose, you should pre-create all of the following folders.
# Folders for Docker State:
# /volume1/dockerdata. - root where this docker-compose.yml should live
# /volume1/dockerdata/plex - Plex config and DB
# /volume1/dockerdata/sonarr - Sonarr config and DB
@mecid
mecid / Calendar.swift
Last active September 26, 2023 09:31
SwiftUI Calendar view using LazyVGrid
View Calendar.swift
import SwiftUI
extension Calendar {
func generateDates(
inside interval: DateInterval,
matching components: DateComponents
) -> [Date] {
var dates: [Date] = []
dates.append(interval.start)
@hwhw
hwhw / cc2538-and-openocd.md
Last active July 2, 2023 19:59
Flashing CC2538 using OpenOCD (&UART)
View cc2538-and-openocd.md

Flashing CC2538 using OpenOCD (&UART)

Problem description

CC2538 SoCs are Cortex-M4 based SoCs by Texas Instruments for 802.15.4 PAN networking, especially for Zigbee communication using their Zigbee Stack solution. It also is a solid foundation for hobbyist-grade solutions involving Zigbee communication, especially for running a self-implemented Zigbee coordinator (often called "Zigbee gateway" in commercial distribution of similar tech). Software-wise, this is usually done by running "ZNP" (Zigbee Network Processor) firmware on the SoC and using a separate controller/computer to act as the "ZAP" (Zigbee Application Processor). In a hobbyist setting, the former is usually a cheap module from china containing the chip, capacitors and an antenna or antenna connector, while the latter is e.g. a Raspberry Pi or an Intel NUC or whatever floats your boat. The API between both components is specified and so the software side on the ZAP does not need to bother with Zigbee communication states but can act on a