Skip to content

Content Tagged "command"

Page 1 of 1

Some useful docker commands

June 2, 2021Categories: it, tutorial
The other day I had to reboot one of my machines running docker. I've noticed that only a number of containers restarted on reboot. What's worse, is that my pihole container didn't. Oops. So I've decided to look into it and found a number of docker commands which helped me: Processes Docker has a…

Execute a Command in Every Directory with Bash

July 13, 2018Categories: Software, Tutorial
TL;DR : Use a find-based loop The other day I was wondering how to execute a command in each sub-directory of a project. In python , you have os.walk . In C , I would've probably written myself something just for fun etc. In shell , I know you have find which is capable of finding all…

Docker Exec Path-based Commands

November 17, 2017Categories: IT, Tutorial
TL;DR: Use sh -c "command with arguments" I've tried to execute in order to see the size used by a container's logs. Unfortunately, this resulted in an error along the lines: du: C:/Program Files/Git: No such file or directory This means that my git bash prompt interpreted the / itself. In…

Show What's on Swap in Linux

November 6, 2017Categories: IT, Tutorial
If you find your machine running sluggish, it might be the case that you have too many things running and it's hitting the swap. You can check how bad (or good) things are with htop , but it won't tell you which process is sitting on swap. To find out, I've cooked up a tiny script: It will look in…

Electron AppSend Menu Command to Angular App

December 9, 2016Categories: Software, Tutorial
TL;DR: In the main process use mainWindow.webContents.send('cmd') and in your Angular component ( renderer process) bind it to a method with ipcRenderer.on('cmd', (where open() is a method). I need to make my angular app work when a menu item is clicked (think: I…

Replace a colour in an image with imagemagick

June 8, 2016Categories: IT, Tutorial
I had to change the colour of some monochrome icons for a personal project, from black to something else (i.e. not black). I've tried in python with PIL. Unfortunately, my attempts to use ImageOps failed miserably, because I'm working with RGBA images, not RGB :(. Of course, one could separate…

All tags