Skip to content

Instantly share code, notes, and snippets.

@aroemen
aroemen / restore-git-submodules.sh
Created February 25, 2013 02:39
Restore git submodules from .gitmodules. Since git submodule init only considers submodules that already are in the index (i.e. "staged") for initialization this short script parses .gitmodules, and each url and path pair.
#!/bin/sh
set -e
git config -f .gitmodules --get-regexp '^submodule\..*\.path$' |
while read path_key path
do
url_key=$(echo $path_key | sed 's/\.path/.url/')
url=$(git config -f .gitmodules --get "$url_key")
git submodule add $url $path
@daniel-j
daniel-j / wallpaper-changer
Last active July 26, 2022 08:07
This is a simple random wallpaper changer to use with Awesome WM. You need to install feh to use this.
#!/bin/bash
#
# Created by djazz // Dangershy
# Dependencies: feh
#
FOLDER="~/Pictures/wallpapers"
DELAY=10
# to make it loop over lines instead of spaces in filenames
@tokhi
tokhi / unixToolbox.md
Last active December 17, 2023 20:43
Collection of Unix/Linux/BSD commands and tasks which are useful for IT work or for advanced users.

#Unix Toolbox

This document is a collection of Unix/Linux/BSD commands and tasks which are useful for IT work or for advanced users. This is a practical guide with concise explanations, however the reader is supposed to know what s/he is doing.

##Unix Toolbox revision 14.4

The latest version of this document can be found at http://cb.vu/unixtoolbox.xhtml. Replace .xhtml on the link with .pdf for the PDF version and with .book.pdf for the booklet version. On a duplex printer the booklet will create a small book ready to bind. This XHTML page can be converted into a nice PDF document with a CSS3 compliant application (see the script example). See also the about page.
Error reports and comments are m
@mavieth
mavieth / colors.sh
Created February 26, 2016 19:36
Bash script color output
#!/bin/bash
DARKGRAY='\033[1;30m'
RED='\033[0;31m'
LIGHTRED='\033[1;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
LIGHTPURPLE='\033[1;35m'
@steinwaywhw
steinwaywhw / One Liner to Download the Latest Release from Github Repo.md
Last active May 5, 2024 20:02
One Liner to Download the Latest Release from Github Repo
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
# coding: utf-8
# Licensed under the MIT License
# Copyright © 2016 Bharadwaj Raju <bharadwaj.raju@keemail.me>
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to permit persons
# to whom the Software is furnished to do so, subject to the following conditions:
@elerch
elerch / arch-usb-uefi.md
Last active January 26, 2024 22:20
Installation of Arch Linux on a USB stick with UEFI and legacy BIOS Support

Our goal here is to have one USB stick to rule them all. Objectives:

  • We want a full system - not a live CD
  • We want to boot this system on a Macbook Pro (requires UEFI)
  • We want to boot this system on a Acer C720 Chromebook (requires Legacy BIOS support)
  • We want the system "functional"

The last bullet is subject to interpretation, but I'm defining functional as:

  • X Windows works (with LXDE)
@ruario
ruario / README.md
Last active July 26, 2022 07:23
Run Vivaldi Package (rpm, deb or recompressed contents)

Run Vivaldi Package

The attached script (rvp.sh) will allow you to directly run a Vivaldi .deb or .rpm package without “installing” it. This works by quickly extracting the package contents into /var/tmp and then executing the binary therein (the extracted files are removed when you close Vivaldi).

Vivaldi is run with a temporary user data (settings) that are specific to that exact version. This is to avoid messing up the main install's user data.

To run Vivaldi in this way, make rvp.sh executable and start a build like so:

./rvp.sh vivaldi-snapshot-1.15.1159.7-1.x86_64.rpm
@keclements
keclements / github-git-stuff
Last active February 7, 2024 02:52
sessions
--------------------------
2018_04_24
------------
----------------
* [How to fork your own repo in Github](http://kroltech.com/2014/01/01/quick-tip-how-to-fork-your-own-repo-in-github/)
* [Directory](https://apis.guru/openapi-directory/)
* [Top 20 Best Tech Websites & Blogs](http://www.grafdom.com/blog/top-20-best-tech-websites-and-blogs/)
* [Indie Hackers: Work Together to Build Profitable Online Businesses](https://www.indiehackers.com/)