Skip to content

Instantly share code, notes, and snippets.

View projectivemotion's full-sized avatar
👽
let's work

Amado Martinez projectivemotion

👽
let's work
View GitHub Profile
@projectivemotion
projectivemotion / timewarrior-cheatsheet.md
Last active February 21, 2023 11:15
Timewarrior Cheatsheet
@projectivemotion
projectivemotion / migrate.sh
Created November 2, 2016 05:06
Centos7 Server Migration Script
#!/bin/env bash
#
# Author: Amado Martinez - AmadoMartinez.mx
# License: MIT License
# Date: 2016-11-02
#
# Migrate to CentOS7 Script
# provide newhost argument to transfer data and launch import and init processes to the new machine.
# ssh keys must be setup on remote system.
# use import argument for importing migration data and install services

TaskWarrior Quick Cheat Sheet

Last Update: 2017-01-11

Undelete a Task

task [id] modify end: status:pending

Undelete tasks that were deleted today

task +DELETED end:today modify end: status:pending
@projectivemotion
projectivemotion / taskwarrior.js
Last active September 1, 2016 07:48
Example Script to obtain taskwarrior information using node js
/**
* Amado Martinez <amadomartinez.mx>
*
* Example Typescript / Javascript to retrieve taskwarrior data
*/
var execSync = require("child_process").execSync;
var getIds = (filter) => {
let ids = execSync("task " + filter + " _id").toString().split("\n");
ids.pop(); // remove empty line
return ids;
@projectivemotion
projectivemotion / i3status.ts
Created August 31, 2016 14:43
Typescript Implementation of a simple node js wrapper which prefixes each i3status line with custom information.
///<reference path="node.d.ts"/>
/**
* Author: Amado Martinez <amadomartinez.mx>
* License: MIT
* Date: 2016-08-31
*
# information. To use it, ensure your ~/.i3status.conf contains this line:
# output_format = "i3bar"
# in the 'general' section.
# Then, in your ~/.i3/config, use:
@projectivemotion
projectivemotion / wpbackup.sh
Created August 11, 2016 08:57
Create a full backup of a Wordpress Website in one single step with this bash script.
#!/bin/env bash
#
# Author: Amado Martinez - AmadoMartinez.mx
# License: MIT License
# Date: 2016-08-11
#
# Backup a complete wordpress installation
#
if [ $# -lt 2 ] ; then
@projectivemotion
projectivemotion / i3statusphp
Last active August 10, 2016 12:44
i3 status php wrapper for appending currency rate / bitcoin rate in i3 status bar
#!/usr/bin/env php
<?php
/**
* Author: Amado Martinez
* License: MIT
* Date: 2016-07-22
*
* modify .i3status.conf general section: output_format = "i3bar"
* modify i3 config: status_command i3status -c .i3status.conf | php -f ~/bin/i3statusphp
*
@projectivemotion
projectivemotion / php-unresolved-symlinked-path.php
Last active May 25, 2018 18:45
Get unresolved path of symlinked php file. Does the opposite of realpath().
<?php
/**
* Returns the Symlink (Non-Realpath) of the current script.
* I am not so sure how well this function works from inside include's.
* Use case:
*
* [amado@gravedigger phpcode]$ php -f subdir/mysymlink/subdir/mysymlink/subdir/mysymlink/app.php
* PWD: /tmp/phpcode
* SCRIPT_FILENAME: subdir/mysymlink/subdir/mysymlink/subdir/mysymlink/app.php
* ___FILE__ : /tmp/phpcode/app.php
@projectivemotion
projectivemotion / flash
Created May 10, 2016 08:00
Flash Terminal Color, Blink Terminal Colors
#!/bin/bash
#
# Author: Amado Martinez - AmadoMartinez.mx
# License: MIT License
# Date: 2016-05-10
#
# Keywords: Flash Terminal Color Shell Color Blink Alert
#
if [ $# -lt 2 ] ; then
@projectivemotion
projectivemotion / shotwell_filenames_by_tag.sh
Last active July 31, 2021 20:21
Print Shotwell Photo Filenames by Tag
#!/bin/env bash
#
# Author: Amado Martinez - AmadoMartinez.mx
# License: MIT License
# Date: 2016-05-02
#
# Example:
# $ ./shotwell_filenames_by_tag.sh ~/.local/share/shotwell/data/photo.db MyTag
#