Skip to content

Instantly share code, notes, and snippets.

@gbl08ma
gbl08ma / tny
Created July 30, 2013 17:40
Unix shell script to shorten URLs with tny.im URL shortener. wget must be installed for this to work.
#!/bin/sh
if [ -t 0 ]; then
if [ -z "$1" ]; then
echo "usage: tny long_url [custom_keyword]"
echo ""
echo "Shorten URLs with tny.im URL shortener"
echo "This script expects a long URL to shorten either as an argument or passed through STDIN."
echo "When using arguments, an optional second argument can be provided to customize the later part of the short URL (keyword)."
exit 1
fi
@mqu
mqu / usb-auto-backup
Last active October 3, 2023 14:43
usb-auto-backup script - a script connected to UDEV daemon, running rsync backup when user insert USB drive.
TODO :
- manage user notification ; notify-send not really working ; current alternative either.
- display hostid used to customize usb backup script.
INSTALL
- copy usb-auto-backup script to /usr/local/bin,
- create an partition on an USB drive named "backup" ; get id (/dev/sddX) -> will be needed in udev.rules
- identity your drive information for UDEV-rules using : udevadm info -a -p $(udevadm info -q path -n /dev/sdXX)
- create an UDEV rule : /etc/udev/rules.d/99-usb-auto-backup.rules like this one :
@iamtekeste
iamtekeste / Download Google Drive files with WGET
Created July 8, 2015 11:00
Download Google Drive files with WGET
Download Google Drive files with WGET
Example Google Drive download link:
https://docs.google.com/open?id=[ID]
To download the file with WGET you need to use this link:
https://googledrive.com/host/[ID]
Example WGET command:
@cabal95
cabal95 / vm-backup.sh
Created July 25, 2015 17:53
I use this script to backup my QEMU/KVM/libVirt virtual machines. The script requires KVM 2.1+ since it uses the live blockcommit mode. This means the data in the snapshot disk is rolled back into the original instead of the other way around. Script does NOT handle spaces in paths.
#!/bin/bash
#
BACKUPDEST="$1"
DOMAIN="$2"
MAXBACKUPS="$3"
if [ -z "$BACKUPDEST" -o -z "$DOMAIN" ]; then
echo "Usage: ./vm-backup <backup-folder> <domain> [max-backups]"
exit 1
@kmassada
kmassada / README.md
Last active September 4, 2021 12:22
Vagrant and KVM(QEMU) on Centos7

Libvirt

yum group install -y "Development Tools"
yum -y install qemu-kvm libvirt virt-install bridge-utils libvirt-devel  libxslt-devel libxml2-devel libvirt-devel libguestfs-tools-c
echo "net.ipv4.ip_forward = 1"|sudo tee /etc/sysctl.d/99-ipforward.conf
sysctl -p /etc/sysctl.d/99-ipforward.conf
@abhijeetchopra
abhijeetchopra / 0-README.md
Last active July 15, 2024 07:25
Creating automatic scheduled backup copies of your Google Sheets using Google Apps Script

How to "Schedule Automatic Backups" of your Google Sheets

This tutorial demonstrates how to use Google Apps Script to:

  • Create copies of the Google Sheet in the desired destination folder automatically at set intervals.

  • Append the time stamp with each backup file's name.

  • Adjust time trigger for backing up every day/hour/minute.

@isc30
isc30 / install.bash
Last active January 27, 2021 10:38
Raspberry Pi Install PHP7 + Nginx + MySQL + PhpMyAdmin (last versions)
#!/bin/bash
# Thanks to https://gist.github.com/Lewiscowles1986/ce14296e3f5222082dbaa088ca1954f7
if [ "$(whoami)" != "root" ]; then
echo "Run script as ROOT please. (sudo !!)"
exit
fi
echo "deb http://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free rpi" > /etc/apt/sources.list.d/stretch.list
echo "APT::Default-Release \"jessie\";" > /etc/apt/apt.conf.d/99-default-release
@yifanlu
yifanlu / taihen-b4-release.md
Created November 14, 2016 01:21
taiHENkaku B4 Release Notes

大変革 Beta 4

Developers: Please make sure you are using the latest toolchain from (https://github.com/frangarcj/buildscripts/releases). We made a lot of changes so using an older toolchain to add taiHEN hooks will result in crashes! Also make sure to update your taiHEN development libraries to the latest version.

If you are not interested in helping test the beta, we recommend that you stick with the old stable release at (https://henkaku.xyz/) instead. To update the beta, reboot and visit http://beta.henkaku.xyz/ from your Vita's browser. To remove the beta, delete molecularShell, reboot, and visit https://henkaku.xyz/ instead.

New Features

  • Fixed many bugs that causes instability, memory leaks, and crashes with hooks. Full details here.
  • Fixed dynarec issue resulting in many emulators including PCSX and mGBA not working.
@yifanlu
yifanlu / E80558325.md
Last active October 13, 2023 14:04
Vita 3.65 activation investigation (E-80558325)

On 7/29/2017, all hacked Vitas on 3.60 spoofing the latest firmware (3.65) were blocked from console activation. This is particularly odd because the PSN passphrase did not change in 3.65. Additionally with the release of ensō added to the confusion of what happened. Here is the result of a preliminary investigation of the situation.

Upon game activation, the Vita displays an dialog that shows the error number E-80558325. This error number is used in SceNpKdc, which is found in vs0:external/np_kdc.suprx. The error code itself is created when the activation response is received:

v5 = v45 | 0x80558300;

Here, v5 is the return code and v45 is the string error code from the server converted to a number. The request made to Sony's server looks like the following