Skip to content

Instantly share code, notes, and snippets.

Avatar

Radu Potop radupotop

View GitHub Profile
View example-dbus.conf
tvheadend dbus-1/ root~# cat /usr/local/etc/dbus-1/system.d/avahi-dbus.conf
<!DOCTYPE busconfig PUBLIC
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<!-- Only root or user avahi can own the Avahi service -->
<policy user="avahi">
<allow own="org.freedesktop.Avahi"/>
</policy>
View rc.conf
#
# /etc/rc.conf - Main Configuration for Arch Linux
#
# -----------------------------------------------------------------------
# LOCALIZATION
# -----------------------------------------------------------------------
#
# LOCALE: available languages can be listed with the 'locale -a' command
# DAEMON_LOCALE: If set to 'yes', use $LOCALE as the locale during daemon
View rclone.conf
[Crypto]
type = crypt
remote = SomeLocalRemote:/home/user
...
[SomeLocalRemote]
type = local
View mpd-pulse.service
[Unit]
Description=PulseAudio for MPD
After=sound.target
Before=mpd.service
[Service]
User=mpd
Type=notify
ExecStart=/usr/bin/pulseaudio --daemonize=no
@radupotop
radupotop / gist:5c2664209c14dbb55c777b20ade7794d
Last active Nov 17, 2019
MIUI 10 safe to remove packages
View gist:5c2664209c14dbb55c777b20ade7794d
# In the adb shell
pm list packages
pm uninstall -k --user 0 <package>
com.android.browser
com.android.calendar
com.android.mms
com.android.providers.downloads.ui # only remove the UI package!
@radupotop
radupotop / ffmpeg.sh
Last active Nov 10, 2019
Transcoding with FFMPEG
View ffmpeg.sh
# Transcode
ffmpeg -i inputfile \
-map 0 \ # choose the track by index
-c:v copy \ # codec:video - copy as is
-c:s copy \ # codec:subtitles - copy as is
-c:a ac3 -b:a 640k \ # codec:audio - transcode to AC3, maximum bitrate
outfile
# Just get info about the codecs used and available tracks
ffmpeg -i inputfile
@radupotop
radupotop / mpd.conf
Created Oct 23, 2019
Example MPD audio stream
View mpd.conf
audio_output {
type "httpd"
name "HTTP Stream"
encoder "flac" # null vorbis lame wave flac
port "8000"
bind_to_address "0.0.0.0" # optional, IPv4 or IPv6
#quality "0" # do not define if bitrate is defined
always_on "yes"
tags "yes"
format "44100:16:2"
@radupotop
radupotop / wget.sh
Created Aug 23, 2019 — forked from Dammmien/wget.sh
wget cheat sheet
View wget.sh
# POST a JSON file and redirect output to stdout
wget -q -O - --header="Content-Type:application/json" --post-file=foo.json http://127.0.0.1
# Download a complete website
wget -m -r -linf -k -p -q -E -e robots=off http://127.0.0.1
# But it may be sufficient
wget -mpk http://127.0.0.1
# Download all images of a website
View vsftpd.conf
# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
View gist:898d6504272a927496fc94d91916c34e
> http --head "http://localhost:8000/reports/screening_report?username=radu.potop@polestarglobal.com&api_key=4b3e857ab2af1a830c3cbbd21aea1e42c48aa02b"
HTTP/1.0 500 Internal Server Error
Content-Length: 139657
Content-Type: text/html
Date: Mon, 20 May 2019 10:35:03 GMT
Server: WSGIServer/0.2 CPython/3.6.7
> http --head "http://localhost:8000/reports/screening_report/?username=radu.potop@polestarglobal.com&api_key=4b3e857ab2af1a830c3cbbd21aea1e42c48aa02b"
HTTP/1.0 500 Internal Server Error
Content-Length: 139672
You can’t perform that action at this time.