Skip to content

Instantly share code, notes, and snippets.

@lovellfelix
lovellfelix / healthcheck.js
Created July 17, 2020 16:03 — forked from PatrickKalkman/healthcheck.js
Healthcheck cmd
const http = require('http');
const config = require('./config');
const log = require('./log');
const constants = require('./constants');
const options = {
host: 'localhost',
port: config.httpPort,
timeout: 2000,
method: 'GET',
@lovellfelix
lovellfelix / healthcheck.js
Created July 17, 2020 16:03 — forked from PatrickKalkman/healthcheck.js
Healthcheck cmd
const http = require('http');
const config = require('./config');
const log = require('./log');
const constants = require('./constants');
const options = {
host: 'localhost',
port: config.httpPort,
timeout: 2000,
method: 'GET',
@lovellfelix
lovellfelix / git-reset-author.sh
Created September 27, 2018 16:20 — forked from bgromov/git-reset-author.sh
Git: reset author for ALL commits
#!/bin/sh
# Credits: http://stackoverflow.com/a/750191
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='Newname'
GIT_AUTHOR_EMAIL='new@email'
GIT_COMMITTER_NAME='Newname'
GIT_COMMITTER_EMAIL='new@email'
" HEAD
'use strict';
// imports node modules
const express = require('express');
const mongojs = require('mongojs');
const bodyParser = require('body-parser');
const jwt = require('jsonwebtoken');
// creates Express app with JSON body parser
const app = new express();
app.use(bodyParser.json());
@lovellfelix
lovellfelix / networks.js
Created April 29, 2016 20:13 — forked from josephdburdick/networks.js
Seeds Mongo database but is immediately removed.
Networks = new Mongo.Collection('networks');
Networks.remove({});
if (Meteor.isServer) {
Networks.allow({
insert: function (userId, doc) {
return true; //userId === doc.userId;
},
update: function (userId, doc, fieldNames, modifier) {
return true; // userId === doc.userId;
@lovellfelix
lovellfelix / undo-git-rebase.sh
Created April 27, 2016 13:01 — forked from rymawby/undo-git-rebase.sh
Undoing a git rebase
# find head commit
git reflog
# now reset hard - where N is the head commit found in the reflog
git reset --hard HEAD@{N}
// These two need to be declared outside the try/catch
// so that they can be closed in the finally block.
HttpURLConnection urlConnection = null;
BufferedReader reader = null;
// Will contain the raw JSON response as a string.
String forecastJsonStr = null;
try {
// Construct the URL for the OpenWeatherMap query
#!/bin/bash
##########################
## Check if run as root ##
##########################
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
<provider
android:name=".providers.AssetProvider"
android:authorities="@string/provider_asset"
android:multiprocess="true"
android:exported="true"/>
<provider
android:name=".providers.AssetTagProvider"
android:authorities="@string/provider_assettags"
android:multiprocess="true"
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static