Skip to content

Instantly share code, notes, and snippets.


Yury Bushev bushev

View GitHub Profile
bushev / script.js
Created March 19, 2020 19:50
Remove duplicated files from Moments (Synology NAS)
View script.js
// Very fast-coded deduplication utility. It parses standard "Storage Analyzer" report and moves duplicated files to a separate folder.
// Requires "npm i csv-parse 'move-file"
'use strict';
const path = require('path')
const fs = require('fs')
const parse = require('csv-parse/lib/sync')
const moveFile = require('move-file');

Add method handleDroppedFile:

async handleDroppedFile(payload) {'compressor.compressed', {
    ...await this.compressFile(payload.filePath)

Add handleEvent method:

handleEvent(payload, sender, event) {

  this.metadata.webContents.send(event, payload);

Subscribe on event emit in method serviceCreated:

View ipc.service.ts
import { Injectable } from '@angular/core';
import { ElectronService } from 'ngx-electron';
import * as _ from 'lodash';
providedIn: 'root'
export class IPCService {
View bootstrap.js
'use strict';
const { spawn } = require('threads');
const { ServiceBroker } = require('moleculer');
const ElectronService = require('./services/electron.service');
class Loader {
static get config() {
View electron.service.js
const {Service} = require('moleculer');
const {app, ipcMain} = require('electron');
class ElectronService extends Service {
constructor(broker) {
name: 'electron',
View compressor.service.js
const { Service } = require('moleculer');
const compressFileHelper = require('../utils/compress-file');
class CompressorService extends Service {
constructor(broker) {
bushev /
Created February 5, 2018 13:15
NeDB - how to start
bushev / index.js
Created January 31, 2018 11:07
Macbook power state alerting [Node.js]
View index.js
'use strict';
const exec = require('child_process').exec;
const https = require('https');
const API_KEY = `*****`;
const PHONE_NUMBER = `7920*****`;
let state = 'Unknown';
bushev /
Last active September 23, 2022 10:39
How to hide IP address without of VPN on iOS for free

In order to tunnel all iOS Internet traffic using SSH:

  1. Get this app: SSHTunnel
  2. Create a tunnel with type "Dynamic" & connect.
  3. Click on the config.pac file to copy it to a clipboard.
  4. Go to Settings > General > Network > Wi-Fi and tap the blue arrow on the right side of the entry for your network. Scroll down to the "Proxy" section and tap "Auto". Paste URL to a pac file from a clipboard.
  5. Have a FUN!

See a detailed video: