Skip to content

Instantly share code, notes, and snippets.

View nicekiwi's full-sized avatar
🍳
Living brunch to brunch.

Ezra nicekiwi

🍳
Living brunch to brunch.
View GitHub Profile
@jcalonso
jcalonso / bluehostDBBackup
Created May 1, 2014 20:47
Backup databases from bluehost
#!/bin/sh
LOGFILE=/tmp/bluehost_backup.log
EXPECTED_ARGUMENTS=3
exec 6>&1 # Link file descriptor #6 with the standard output
exec > $LOGFILE # stdout sent to $LOGFILE
#Check script arguments
if [ $# -ne $EXPECTED_ARGUMENTS ]
then
echo "No arguments supplied."
@hotfix31
hotfix31 / jquery.getPath.js
Created May 28, 2014 08:55
GetPath for jQuery : Get a unique path for one element
jQuery.fn.getPath = function () {
if (this.length != 1) throw 'Requires one element.';
var path, node = this;
while (node.length) {
var realNode = node[0], name = realNode.localName;
if (!name) break;
name = name.toLowerCase();
var parent = node.parent();
@p3lim
p3lim / formatted.md
Last active January 8, 2022 06:19
Planetside2 - Formatted API dumps

Servers - census

id name
1 Connery
10 Miller
13 Cobalt
17 Emerald
25 Briggs
@ferki
ferki / lockscreen.sh
Created August 2, 2014 18:00
lockscreen
#!/bin/sh
#check if i3lock is already running
pgrep i3lock > /dev/null && exit 1
#make screenshot
scrot ~/lockscreen.png
#apply blur
mogrify -filter Gaussian -resize 20% -define filter:sigma=1 -resize 500% ~/lockscreen.png
#mogrify -blur 0x8 ~/lockscreen.png
#!/bin/bash
#
# Automate mysql secure installation for debian-baed systems
#
# - You can set a password for root accounts.
# - You can remove root accounts that are accessible from outside the local host.
# - You can remove anonymous-user accounts.
# - You can remove the test database (which by default can be accessed by all users, even anonymous users),
# and privileges that permit anyone to access databases with names that start with test_.
@imranity
imranity / gist:9246dd195f785cf4783d
Created February 13, 2015 22:38
How to solve "sudo: no tty present and no askpass program specified" when trying to run a shell from Jenkins
Running shell scripts that have contain sudo commands in them from jenkins might not run as expected. To fix this, follow along
Simple steps:
1. On ubuntu based systems, run " $ sudo visudo "
2. this will open /etc/sudoers file.
3. If your jenkins user is already in that file, then modify to look like this:
jenkins ALL=(ALL) NOPASSWD: ALL
4. save the file by doing Ctrl+O (dont save in tmp file. save in /etc/sudoers, confirm overwrite)
5. Exit by doing Ctrl+X
6. Relaunch your jenkins job
@JeffPaine
JeffPaine / i3-cheat-sheet.md
Last active December 16, 2025 14:21
i3 Window Manager Cheat Sheet

i3 Window Manager Cheat Sheet

$mod refers to the modifier key (alt by default)

General

  • startx i3 start i3 from command line
  • $mod+<Enter> open a terminal
  • $mod+d open dmenu (text based program launcher)
  • $mod+r resize mode ( or to leave resize mode)
  • $mod+shift+e exit i3
@Remiii
Remiii / README.md
Last active May 26, 2025 00:46
How to delete Vault (AWS Glacier) 🗻

How to delete Vault (AWS Glacier)

This Gist give some tips in order to remove AWS Glacier Vault with AWS CLI (ie. https://aws.amazon.com/en/cli/).

Step 1 / Retrive inventory

$ aws glacier initiate-job --job-parameters '{"Type": "inventory-retrieval"}' --vault-name YOUR_VAULT_NAME --account-id YOUR_ACCOUNT_ID --region YOUR_REGION
@btkostner
btkostner / schema.js
Last active January 30, 2016 07:15
upsert (update or create) a nested array in mongoose near atomicly without save function
import mongoose from 'mongoose';
import _ from 'lodash';
import dotize from 'dotize';
ApplicationSchema.methods.upsertRelease = function(query, object) {
const application = this;
// Create an object from query using dot notation instead of objects ('releases.github.id')
const dotQuery = dotize.convert(query, 'releases');
// Create an object of values to update to, uses mongoose's $ operator
@AshikNesin
AshikNesin / react-file-upload.js
Created February 2, 2017 06:46
Simple React File Upload
import React from 'react'
import axios, { post } from 'axios';
class SimpleReactFileUpload extends React.Component {
constructor(props) {
super(props);
this.state ={
file:null
}