Skip to content

Instantly share code, notes, and snippets.

@weshouman
weshouman / docker_ps_specific_period.sh
Created January 24, 2020 11:09
a script to get the containers based on their age
# -------
## Status
# -------
# export DISABLE_STATUS="true" # any status
export DISABLE_STATUS="" # the specified status
export RUNNING=true
# export RUNNING=false
# -----
@weshouman
weshouman / sublime_plugins.md
Last active January 18, 2020 13:13
A list of useful plugins
@weshouman
weshouman / sublime_plugins.md
Created January 18, 2020 13:11
A list of useful plugins
@weshouman
weshouman / pins.md
Created December 14, 2019 10:17
some RJ hints

6 pin standards

The standard colors could be found here

  • RJ11 is a 6p2c schema (6 pin 2 conductors)
  • RJ14 is a 6p4c schema
  • RJ25 is a 6p6c schema
    The table for the different RJ pin layout could be found here

RJ45

  • RJ45S is 8p8c schema, follow the 8 pin schema
  • It has two different schemas T568A and T568B
@weshouman
weshouman / log_finder.md
Last active December 9, 2019 14:41
diff directory tree upon changes after executing a script

Sometimes we don't know which file exactly changed upon execution, usually it's something in the /var/log/ and may be in the tmp or even next to the application executable.

Method 1 - Size Differences

To handle such a situation, we may get the logical size (not physical size) of all the non-zero files then run the script.sh then get the new non-zero sizes and diff the outputs to get the specific files that got a change in size

TL;DR

@weshouman
weshouman / rpi_advanced.md
Last active April 26, 2021 05:55
Advanced RPI tips

Automated spawning of RPI images

  • We could use Vagrant to spawn an arm VM using this guide
  • The flow is like Vagrant -> Libvirt -> KVM -> QEMU -> Modified RPI image.
  • I remember finding an ansible book that modifies the RPI image for us, but I can't find it now ...

Mix Sound of Multi RPIs

To use a single speaker for multiple rpis, it would be tricky to search for that as Google will always redirect to multiple speakers a single rpi option.
Instead search for DAW mixer, here's a good list.
My understanding is that, the cheapest thing would be to utilize a whole SoC to mix between differen rpis and capture the sound output of this SoC. A [physical mixer](https://www.amazon.com/Rolls-MX42-Stereo-Mini-Mixer/dp/B00102ZN40/ref=sr_1_3?ots=1&slotNum=2&imprToken=bcb94584-e9de-a05d-6b7&tag=ars

@weshouman
weshouman / devops_tips.md
Created December 9, 2019 09:32
Devops tips and tricks

Vagrant

  • To run a GUI (no need for X) in a virtualbox, use vb.gui = true in the virtualbox section
  • To run a GUI (with X Windows Server) in a virtualbox, instead of just forwarding, follow this guide
@weshouman
weshouman / gitlab_logs.md
Last active December 7, 2019 13:58
Gitlab Logs

A trip into the logs of gitlab.

Structure

To understand which file to check and when, following is the structure tree of the logs

.
├── gitlab
│   ├── api_json.log
│   ├── application.log  ----------- (Headline of the performed tasks by gitlab)
│   ├── audit_json.log
@weshouman
weshouman / advanced_x_on_tty.md
Created December 5, 2019 21:14
Multi terminals on laptop

Answer is here

Steps are:

sudo X -quiet -nolisten tcp -noreset :4 vt8
DISPLAY=:4 virtualbox &

then ctrl+alt+f8 I recommend using the first command on a tty that isn't 7 (may be tty6) and the same for the other command on may be tty5.

@weshouman
weshouman / resources.md
Last active August 21, 2020 12:23
An overview of systemd