Skip to content

Instantly share code, notes, and snippets.

View arevindh's full-sized avatar
🤠
Focusing

itsmesid arevindh

🤠
Focusing
View GitHub Profile
{
"info": {
"_postman_id": "32c262fa-7384-4477-a610-cde252c8829e",
"name": "Tinxy Open APIs",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Device State",
"request": {
@arevindh
arevindh / mongo_prune_js.js
Created July 17, 2021 15:22
mongo_prune_js.js
// keep N-day worth of data
var days=7;
// change to false to have the script to really exclude old records
// from the database. While true, no change at all will be made to the DB
var dryrun=true;
var now = new Date().getTime(),
time_criteria = now ;
time_criteria_in_seconds = time_criteria / 1000;
// keep N-day worth of data
var days=7;
// change to false to have the script to really exclude old records
// from the database. While true, no change at all will be made to the DB
var dryrun=true;
var now = new Date().getTime(),
time_criteria = now ;
time_criteria_in_seconds = time_criteria / 1000;
@arevindh
arevindh / .htaccess
Last active February 21, 2020 10:16
.htaccess for react router
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteRule ^(Shibboleth.sso)($|/) - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule . /index.html [L]
@arevindh
arevindh / freenas_11_vm_not_booting_fix.txt
Created September 14, 2018 18:31
Freenas 11 VM not booting fix
#source https://www.reddit.com/r/freenas/comments/71no06/freenas_11_vm_not_booting/dncdmst/
On Ubuntu this worked for me too. If Grub is updated later you might have to copy it again.. Usually you can always manually boot from shell. Follow these steps:
When on UEFI Interactive Shell; type: exit
In the EFI menu system navigate to "Boot Maintenance Manager"
Select "Boot from file"
@arevindh
arevindh / java.txt
Created September 7, 2018 16:40
Another Java installation is in progress.
%appdata%\..\LocalLow\Oracle\Java
delete JAVA_INSTALL_FLAG
@arevindh
arevindh / update_pihole.sh
Last active December 13, 2017 16:59
update Pihole to 3.2
sudo su
#get latest admin repo
cd /var/www/html/admin
#if git remote -v gives something " origin https://github.com/arevindh/AdminLTE "
git pull
# if git remote -v gives something " mod https://github.com/arevindh/AdminLTE "
git pull mod master
https://community.ubnt.com/t5/EdgeMAX/WAN-Failure-notification/td-p/771248/page/2
I know I'm resurrecting an old thread, but here's the script and command I used. Hopefully it helps someone.
It's pretty basic, but it works. I used an external SMTP delivery service, Mailgun, to handle the email transport - this allows me to just use curl to send the message via their API. Mailgun is free for upto 10,000 emails/month.
set load-balance group WAN_FAILOVER transition-script /config/scripts/wlb-notification
#!/bin/bash
@arevindh
arevindh / update pihole-speedtest.sh
Last active July 18, 2017 18:42
update pihole speedtest
sudo su
#### -> If you dont have speedtest.db in /etc/pihole
#### -> cp /var/www/html/admin/scripts/pi-hole/speedtest/speedtest.db /etc/pihole/ <- only if you are on First version
# get latest webpage.sh file
cd /opt/pihole/
mv webpage.sh webpage.sh.mod
wget https://github.com/arevindh/pi-hole/raw/master/advanced/Scripts/webpage.sh
#get latest admin repo
@arevindh
arevindh / alsa.conf
Created May 25, 2017 15:08
alsa.conf modification
sudo nano /usr/share/alsa/alsa.conf
## then replace
defaults.ctl.card 0
defaults.pcm.card 0
defaults.ctl.card 0
defaults.pcm.card 0