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 / 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 / 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"
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);
}
@p3x-robot
p3x-robot / mongodb-replicate.js
Last active April 17, 2018 18:00
MongoDB replicate
db.financialdocuments.insertMany(
db.financialdocuments.find(
{},
{'_id': false}
)
);
@p3x-robot
p3x-robot / readme.md
Last active April 19, 2018 18:17
💺 Re-install util-linux
@p3x-robot
p3x-robot / samba-private-named.conf.update
Last active April 25, 2018 21:38
Samba after 4.6 with domain server Bind / Named configuration changed ☠️
/* this file is auto-generated - do not edit */
/* Replace the * with a period (.) after ms-self. */
/* That field is just a placeholder and could be forgotten */
/* leading to the type list being wrongly interpreted. */
/* Named now requires it to be a period. */
/* Right after ms-self, now not *, but . */
update-policy {
grant CORY-DC.COMPANY.COM ms-self . A AAAA;
grant Administrator@CORY-DC.COMPANY.COM wildcard * A AAAA SRV CNAME;
grant SERVER$@cory-dc.company.com wildcard * A AAAA SRV CNAME;
@p3x-robot
p3x-robot / windows-10-hdr-nvidia.txt
Created November 19, 2018 11:44
Make Nvidia enable HDR in Windows
Set display settings to HDR.
In NVIDIA control panel, set the settings to 4:2:2 x 10bit (maybe 8 is working - depends)
@p3x-robot
p3x-robot / debian-testing-build-msmtp-mta.sh
Last active January 3, 2019 21:53
Debian Testing / Buster / Bullseye MSMTP / MSMTP-MTA not working, here how to build it
# it will mirror the debian msmtp-mta, but works with TLS!!!
# based on
# https://gitlab.marlam.de/marlam/msmtp/issues/24
sudo -i
cd /root
git clone https://gitlab.marlam.de/marlam/msmtp.git
cd msmtp
git checkout tags/msmtp-1.8.1
# i removed the msmtp msmtp-mta, because it replaces
@p3x-robot
p3x-robot / domain.com.conf
Last active January 6, 2019 14:45
JOOMLA always enable HTTPS on NGINX HTTP Reverse Proxy
# in the proxy part, add in this:
proxy_set_header X-Forwarded-Proto https;
@p3x-robot
p3x-robot / hack-remove-decorators.js
Last active February 25, 2019 11:02
⛮ How to disable the remove Angular decorators @ngtools/webpack mess
const fs = require('fs');
const cwd = process.cwd();
const hackPath = `${cwd}/node_modules/@ngtools/webpack/src`
const hackFileName = `${hackPath}/angular_compiler_plugin.js`
const hackFileNameHacked = `${hackFileName}.hacked`
const log = '@ngtool/webpack angular decorators remove'
const hack = () => {
if (!fs.existsSync(hackFileNameHacked)) {
const problemCode = fs.readFileSync(hackFileName).toString('utf-8').split('\n');