{"id":20495614,"url":"https://github.com/tambeta/scripts","last_synced_at":"2025-04-13T17:44:05.915Z","repository":{"id":182839032,"uuid":"46867057","full_name":"tambeta/scripts","owner":"tambeta","description":"Sundry command-line scripts for Unix-like systems","archived":false,"fork":false,"pushed_at":"2019-03-27T09:33:55.000Z","size":52,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T08:45:12.693Z","etag":null,"topics":["arch","arch-linux","archlinux","backup","bash","bash-script","control-vlc","eesti","estonia","iptv","perl","stream"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tambeta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-11-25T14:38:32.000Z","updated_at":"2024-02-15T21:55:09.000Z","dependencies_parsed_at":"2023-07-21T18:54:01.777Z","dependency_job_id":null,"html_url":"https://github.com/tambeta/scripts","commit_stats":null,"previous_names":["tambeta/scripts"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tambeta%2Fscripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tambeta%2Fscripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tambeta%2Fscripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tambeta%2Fscripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tambeta","download_url":"https://codeload.github.com/tambeta/scripts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248756701,"owners_count":21156812,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arch","arch-linux","archlinux","backup","bash","bash-script","control-vlc","eesti","estonia","iptv","perl","stream"],"created_at":"2024-11-15T17:46:36.902Z","updated_at":"2025-04-13T17:44:05.894Z","avatar_url":"https://github.com/tambeta.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nThis repo contains a few sundry scripts potentially useful to the general\nGNU/Linux-using public. The scripts are categorized into directories as follows:\n\n* `arch` - [Arch Linux](http://archlinux.org)-specific scripts\n* `dev` - generic software development-related scripts\n* `eesti` - scripts specific to Estonian services\n* `perl` - [Perl](https://www.perl.org/)-specific scripts\n* `X` - scripts useful within a graphical user environment (X11)\n\nThe root directory contains miscellaneous other scripts, `lib` currently only\ncontains backends for `backup`, `data` contains configuration files. The scripts\nexpect a full-featured modern Linux system as their environment; standard\nrequirements like `perl`, `awk`, `wget` etc. are not listed for each script.\nMany scripts can be run with no arguments, `-h` or `--help` for usage info. I'm\nguilty of the mortal sin of using tabs (4) instad of spaces, so beware.\n\n## backup\n\nA multi-purpose script for backing up a directory tree into a tarball or via\n[duplicity](http://duplicity.nongnu.org/). The script sources `.backup.conf`\nfrom the current working directory for options. See `.backup.conf.example` for a\ntemplate and explanations of options. The tar backend supports\n\n* numbered backups (000, 001, ...)\n* rotating a fixed maximum number of backups through `logrotate`\n* e-mailing the tarball through `mutt`\n* keeping a log file for backups in README\n\nRequires:\n\n* GNU `tar` (for the tar backed)\n* `duplicity` (for the duplicity backend)\n* `logrotate` (for rotating the backups)\n* `mutt` (for e-mailing the backups)\n\nSee `backup`, `lib/backup*` and `.backup.conf.example` for details.\n\n## mp3tag\n\n```\nmp3tag {-t | -f} filename [filename ...]\n```\n\nCopy mp3 tags to the filename as `ARTIST - TITLE.mp3` (`-f`) or write the artist\nand title tags to the mp3 file (`-t`) based on the filename formatted as such. Requires\n[eyeD3](http://eyed3.nicfit.net/).\n\n## vid2x264\n\n```\nConvert a video stream into high quality x264; by default 720p, CRF 20, \npreset: slow.\n```\n\nConvenience frontend to `ffmpeg`. Convert input to x264 video, based on a\nhardcoded profile. Available profiles are currently `720high` and `480med`.\n\nUsage example:\n\n`vid2x264 -i input.mp4 -p 720high output.mkv`\n\n## youtube2mp3\n\n```\nConvert a Youtube video or playlist specified by a passed URL to mp3, use\nmp3tag to write ID3 tags. Arguments are passed to youtube-dl.\n```\n\nRequires `youtube-dl` and `mp3tag` (see above) on `$PATH`.\n\n## arch/ckfpkgs\n\n```\nCheck whether foreign packages have become available in binary \nrepositories\n```\n\n## arch/nongrppkgs\n\n```\nList explicitly-installed packages that are not part of a group\n```\n\n## arch/pkgdate\n\n```\nOutput packages sorted by install date, one per line with the install \ndate prepended to the package name. All command line arguments are \npassed on to pacman.\n```\n\n## arch/rqfpkgs\n\n```\nList foreign packages (e.g. from AUR) that are required by other \npackages\n```\n\n## dev/reflow\n\nA Perl script accepting a block of comments (lines starting with `#` or `//`;\nalso handles Python docstrings) on its standard input and piping a nicely\nformatted result to its standard output.  Use as an editor extension (Geany,\nvim, ...). Requires\n[Text::Autoformat](http://search.cpan.org/~neilb/Text-Autoformat-1.73/lib/Text/Autoformat.pm)\nand pipes the cleaned input through its main routine.  As an extended feature,\nsupports formatting argument list documentation, i.e.\n\n```\n\t// Add a tool to the toolbar. Attributes:\n\t//\n\t// id - identifier string, required\n\t// toggle - a boolean specifying whether the tool is a toggle button\n\t// handlers - an object of [jQuery] event handlers, keyed by event. The handler will \n\t// receive the tool spec object as event.data.\n```\n\nwill be formatted as\n\n```\n\t// Add a tool to the toolbar. Attributes:\n\t// \n\t// id       - identifier string, required\n\t// toggle   - a boolean specifying whether the tool is a toggle button\n\t// handlers - an object of [jQuery] event handlers, keyed by event. The \n\t//            handler will receive the tool spec object as event.data.\n```\n\n## dev/sshagconn\n\nThis script attempts to solve the problem that we would like to have a) secure\nand b) convenient SSH authentication even in environments that are volatile,\nlack secure storage or are not entirely under our control. The specific case\nthat inspired creation of this script was SSH access to git remotes from Docker\ncontainers on a shared server. Setting up SSH keys is beyond the scope of this\ndocument, but this is [covered in detail\nelsewhere](https://confluence.atlassian.com/bitbucket/set-up-ssh-for-git-728138079.html).\n\n`sshagconn` connects to a running\n[`ssh-agent`](https://linux.die.net/man/1/ssh-agent) or launches one if it is\nnot running and consigns the desired SSH private key under its management. The\nprivate key should be encrypted with a passphrase and in this case, the\npassphrase is requested only once between container or machine reboots.  On\nother terminals, the script may simply be run without any further involvement\nfrom the user to set up environment variables pointing to the running\n`ssh-agent` instance. `sshagconn` is meant to run just as `ssh-agent` itself,\ni.e. it outputs some instructions to be parsed by the shell. In Bash, this is\nbest achieved with process substitution:\n\n```\n$ source \u003c(sshagconn /path/to/keyfile)\n```\n\nIt is convenient to alias this to a easily remembered token:\n\n```\n$ alias github='source \u003c(sshagconn /path/to/keyfile)'\n$ alias \u003e ~/.bash_aliases\n$ echo 'source ~/.bash_aliases' \u003e\u003e ~/.bashrc\n```\n\nThe final step is to link the key file to the host name in SSH configuration.\nAdd a similar block to `~/.ssh/config` for each host:\n\n```\nHost github\nHostName github.com\nIdentityFile /path/to/keyfile\n```\n\nIn the future, you only need to invoke `github` on each terminal that you wish\nto use for pushing to remotes:\n\n```\n$ github\n$ git push\n```\n\n## eesti/bank\n\n```\nA script to analyze a Swedbank CSV bank statement and group \nexpenditures by function, based on the groups defined in \n`statementgroups`. Pass the statement and statement groups filenames as \nthe arguments.\n```\n\nWhat it says on the tin. Pass a CSV account statement from Swedbank and a\nstatement groups file (see `data/statementgroups.example`, first column is the\ngroup, second column is a pattern (full Perl regexp, really) to match against\nthe transaction comment or recipient). The output is a neat table of grouped\nexpenditures and incomes. Requires\n[Text::ASCIITable](http://search.cpan.org/~lunatic/Text-ASCIITable-0.20/lib/Text/ASCIITable.pm)\nand [Text::CSV](http://search.cpan.org/~makamaka/Text-CSV-1.33/lib/Text/CSV.pm).\n\n## eesti/iptv\n\nA script for watching or capturing Elion's multicast-based IPTV. Reads `data/iptvrc` for channel \ndefinitions.  If the passed network interface is on IPTV_NET, attempt to open the multicast stream, \notherwise fall back to the web stream. For use with the new router firmware (\u003e=8.C.D.9); see older \nversions (\u003c2016-05) for use with the separate IPTV subnet.\n\nRequires:\n\n* [VLC](http://www.videolan.org/vlc/index.html)\n* [mplayer](http://www.mplayerhq.hu/design7/news.html) (for capturing)\n\n`iptvrc` format:\n\n* 1st column - channel ID\n* 2nd column - mcast stream URL\n* 3rd column - fallback (web) stream URL\n\nUsage:\n\n```\niptv [-c output.mp4] [-a] [-i interface]\n```\n\n* `-i interface` - network interface to use\n* `-c filename` - dump stream to `filename` instead of opening in VLC\n* `-a` - use alternative (fallback) stream\n\n__Note:__ This script possibly requires one or more of the following to use: a) spoof a set-top \nbox's MAC address to the desired network interface, b) set up the multicast route (`route add -net \n224.0.0.0 netmask 240.0.0.0 dev interface_name`) c) force your system to use IGMPv2 d) add an \n`iptables` rule to accept multicast packets, if using the firewall. Please do not contact me about \ntroubleshooting your network configuration.\n\n## eesti/r2get.py\n\nA script for downloading shows from [Raadio 2](http://r2.err.ee/). See `r2get.py\n-h` for more or less comprehensive usage instructions, and the file header for\ntechnical details.\n\nRequirements:\n\n* Python \u003e=2.7, with\n  * [mutagen](https://mutagen.readthedocs.org/en/latest/)\n  * [Beautiful Soup 4](http://www.crummy.com/software/BeautifulSoup/)\n* [ffmpeg](https://www.ffmpeg.org/)\n* [rtmpdump](https://rtmpdump.mplayerhq.hu/)\n\n## eesti/weather\n\n```\nWithout arguments, print the current temperature from \nmeteo.physic.ut.ee If -R is given, print the record temperature days \nthis year. If -r is given, reverse the order (i.e. display the coldest \ndates). If -i is given, invert minima and maxima (i.e. show warmest \ndaily minima with -R, coldest daily maxima with -Rr). -n determines the \nnumber of dates to output. -y determines year, current year by default.\n```\n\n## perl/plckmods\n\n```\nUtility for finding all Perl files under the current directory and \nlisting dependency modules. $* is passed to scandeps.pl. Pass -n to \nlist unavailable dependencies, in such case $* is ignored.\n```\n\nRequires\n[scandeps.pl](http://search.cpan.org/~autrijus/Module-ScanDeps-0.54/script/scandeps.pl)\n\n## perl/plinstall\n\n```\nInstall Perl modules to a specific directory. Pass the prefix as the \nfirst argument and any modules to install as subsequent arguments.\n```\n\n## perl/plmodavail\n\n```\nCheck availability of a Perl module\n```\n\n## perl/plstordmp\n\n```\nDump the contents of a Storable serialized in a file, file name passed \nas the command line argument\n```\n\n## X/ckfs\n\n```\nCheck if there are full-screen windows with title matching a pattern, \nin which case disable power management. Useful for running as a \nfrequent cron job or from a periodic script.\n```\n\n## X/pidginctl\n\n```\nCommand-line control of Pidgin via D-Bus. Currently toggles available / \noffline mode.\n```\n\n## X/remoted.pl\n\nA remote control daemon leveraging the power of [LIRC](http://www.lirc.org/) to\nturn your Android device into a remote for your machine using a client such as\n[this\none](https://play.google.com/store/apps/details?id=com.chham.lirc_client\u0026hl=en).\n\nUsage:\n\n* Set up LIRC on your machine. You may use the [generic remote\n  definition](https://bpaste.net/raw/e1c14b4acbfc), either way, `remoted.pl`\n  expects `devinput` as the remote's ID.\n* Set up the\n  [client](https://play.google.com/store/apps/details?id=com.chham.lirc_client\u0026hl=en)\n  on your android device, download the `devinput` definition from your LIRC\n  server and configure your remote. Note: make sure to use SIMULATE mode.\n* Create an action mapping file, see `data/remotedrc` as an example. This either\n  maps actions to a command to run (two fields) *or* invokes an internal\n  function (three or more fields). In the latter form, the second field is the\n  name of the function in angle brackets and the rest are its arguments. Two\n  functions are available:\n\n  * `\u003cmpris\u003e` - Control VLC via [D-Bus /\n\tMPRIS](http://specifications.freedesktop.org/mpris-spec/latest/). See the\n\t[specification](http://specifications.freedesktop.org/mpris-spec/latest/Player_Interface.html)\n\tfor details; methods for most expected actions (play, stop, seek, etc.) are available.\n  * `\u003cvlc_start\u003e` - Start VLC and open the passed URI (3rd field). If VLC is\n\talready running, no new instance is spawned.\n* Run `remoted.pl`, passing the action mapping file as a parameter. You should\n  be able to control VLC and invoke any other actions via your Android device\n  now.\n\n\n## X/spotifyctl\n\n```\nCommand-line control of Spotify. Pass \"play\", \"pause\", \"next\", \"prev\" \nor \"previous\" as the argument.\n```\n\n## X/windowdim\n\n```\nResize a window (partially) matching the title.\n```\n\nRequires `xdotool`, `xwininfo`.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftambeta%2Fscripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftambeta%2Fscripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftambeta%2Fscripts/lists"}