Skip to content

Instantly share code, notes, and snippets.

View p3x-robot's full-sized avatar
🦝
LOL - opening the sources ...

patrikx3 p3x-robot

🦝
LOL - opening the sources ...
View GitHub Profile
@p3x-robot
p3x-robot / MakeOpenVPN.sh
Created March 31, 2018 12:57 — forked from laurenorsini/MakeOpenVPN.sh
MakeOpenVPN.sh by Eric Jodoin
#!/bin/bash
# Default Variable Declarations
DEFAULT="Default.txt"
FILEEXT=".ovpn"
CRT=".crt"
KEY=".3des.key"
CA="ca.crt"
TA="ta.key"
@p3x-robot
p3x-robot / grub.cfg
Created March 31, 2018 12:56 — forked from Pysis868/grub.cfg
My own configuration file for GRUB2 to boot various live distributions of Linux-based operating systems, along with some system tools. I tried to include a lot of sample configuration entries, even if I don't currently use them, so it may help others. Exceedingly long blog post: http://tehfishyblog.logdown.com/chips/306146-a-homemade-ultimate-bo…
# Config for GNU GRand Unified Bootloader (GRUB) (2)
# /boot/grub/grub.cfg
# or
# /boot/grub2/grub.cfg
# This grub.cfg file was created by Lance http://www.pendrivelinux.com
# Suggested Entries and the suggestor, if available, will also be noted.
# and then improved by Pysis.
@p3x-robot
p3x-robot / ObservableCreate.ts
Created May 10, 2017 13:28
ObservableCreate.ts
// http://stackoverflow.com/questions/42884746/reactivex-observable-to-trigger-when-i-want-to/42902431#42902431
const obs = Observable.create(async (obs : any ) => {
const newInfo = async () => {
return this.http.get(`http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&cache=${new Date().getTime()}`).toPromise();
}
obs.next(await newInfo());
setInterval(async () => {
obs.next(await newInfo());
console.log('update');
}, 10000)
@p3x-robot
p3x-robot / mongodb-replicate.js
Last active April 17, 2018 18:00
MongoDB replicate
db.financialdocuments.insertMany(
db.financialdocuments.find(
{},
{'_id': false}
)
);
mongoose.Schema.prototype._originalDefaultOptions = mongoose.Schema.prototype.defaultOptions;
mongoose.Schema.prototype.defaultOptions = function(options) {
if (options === undefined) {
options = {};
}
options.timestamps = true;
return this._originalDefaultOptions.apply(this._originalDefaultOptions, arguments);
}