Skip to content

Instantly share code, notes, and snippets.

View srgpsk's full-sized avatar

Serge Paskal srgpsk

View GitHub Profile
@srgpsk
srgpsk / gitkeep.md
Created July 29, 2023 18:36
Add empty directory to git

adding empty directories to your repository.

By default Git ignores empty directories, so you won't be able see them in git status or add with git add ....
To vercome the problem - add empty file in each dir that you want to keep in the repo.
Here's the oneliner:

find -type d -empty ! -path '*.git/*' -exec touch "{}/.gitkeep \;
@srgpsk
srgpsk / Ubuntu server on laptop
Created January 22, 2023 01:43
Settings to keep server running with lid closed
Ubuntu server on a laptop, tested on Ubuntu 22.04
- Switch display off
- Do not suspend on lid close
1. Turn off display
> vim /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet consoleblank=30"
> update-grub
@srgpsk
srgpsk / devilbox
Created December 19, 2019 17:34
Devilbox helper. Starts / restarts containers
#!/bin/bash
# Devilbox helper. Starts / restarts containers
if [ "$1" != '' ]; then
cd ~/projects/devilbox
case "$1" in
stop )
docker-compose stop
docker-compose rm -f
@srgpsk
srgpsk / watchme.sh
Created December 19, 2019 17:30
Devilbox helper. Runs npm watch in docker container
#!/bin/sh
# Devilbox helper. Run npm watch in docker container
cd ~/projects/devilbox/ && \
docker-compose exec --user devilbox php bash -l -c "cd path_to_dir;npm run watch;"