Skip to content

Instantly share code, notes, and snippets.

View bushev's full-sized avatar

Yury Bushev bushev

View GitHub Profile
#!/bin/bash
# remove exited containers:
docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v
# remove unused images:
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi
# remove unused volumes:
find '/var/lib/docker/volumes/' -mindepth 1 -maxdepth 1 -type d | grep -vFf <(
@bushev
bushev / ssh-tunnel-ios.md
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: https://www.youtube.com/watch?v=8r0eEr36Dg4

@bushev
bushev / index.js
Created January 31, 2018 11:07
Macbook power state alerting [Node.js]
'use strict';
const exec = require('child_process').exec;
const https = require('https');
const API_KEY = `*****`;
const PHONE_NUMBER = `7920*****`;
let state = 'Unknown';
@bushev
bushev / INFO.md
Created February 5, 2018 13:15
NeDB - how to start
const { Service } = require('moleculer');
const compressFileHelper = require('../utils/compress-file');
class CompressorService extends Service {
constructor(broker) {
super(broker);
this.parseServiceSchema({
const {Service} = require('moleculer');
const {app, ipcMain} = require('electron');
class ElectronService extends Service {
constructor(broker) {
super(broker);
this.parseServiceSchema({
name: 'electron',
'use strict';
const { spawn } = require('threads');
const { ServiceBroker } = require('moleculer');
const ElectronService = require('./services/electron.service');
class Loader {
static get config() {
import { Injectable } from '@angular/core';
import { ElectronService } from 'ngx-electron';
import * as _ from 'lodash';
@Injectable({
providedIn: 'root'
})
export class IPCService {

Add handleEvent method:

handleEvent(payload, sender, event) {

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

Subscribe on event emit in method serviceCreated:

Add method handleDroppedFile:

async handleDroppedFile(payload) {

  this.broker.emit('compressor.compressed', {
    id: payload.id,
    ...await this.compressFile(payload.filePath)
  });
}