Skip to content

Instantly share code, notes, and snippets.

View stepansib's full-sized avatar

Stepan Yudin stepansib

View GitHub Profile
sudo mkdir -p /micro
sudo cd /micro
sudo curl https://getmic.ro | bash
sudo ln -s /micro/micro /usr/local/bin/micro
@stepansib
stepansib / linux-get-directories-size.sh
Created October 21, 2019 06:16
#linux get directories size
du -chd 1 | sort -h
@stepansib
stepansib / docker-containers-using-volume.sh
Created October 21, 2019 06:15
#docker containers using volume
docker ps -a --filter volume=$volumeId
@stepansib
stepansib / docker-disk-usage.sh
Created October 21, 2019 06:14
#docker disk usage
docker system df -v
@stepansib
stepansib / rsync.sh
Created October 19, 2019 12:44
#linux rsync
sshpass -p "pass" rsync -avzP --ignore-existing [email protected]:source/path dest/path
@stepansib
stepansib / git-log-date-range.sh
Last active October 21, 2019 06:56
#git get commits between dates
git log --all --pretty=format:"%ad - %an: %s" --after="2019-09-23" --until="2019-09-27" --author="Stepan Yudin"
@stepansib
stepansib / create-swap.sh
Created September 30, 2019 11:19
#linux setup cache in ubuntu
sudo swapoff /swapfile
sudo rm /swapfile
sudo dd if=/dev/zero of=/swapfile bs=1M count=4096 #create 4 GB swap
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
@stepansib
stepansib / docker-compose-recreate.sh
Created September 26, 2019 20:14
#docker #docker-compose recreate specific service
docker-compose up -d --force-recreate --no-deps service-name
@stepansib
stepansib / garbage-collect.sh
Created September 26, 2019 20:09
#docker registry garbage collect
docker-compose exec registry registry garbage-collect /etc/docker/registry/config.yml
@stepansib
stepansib / get entity attachments.php
Created April 5, 2019 06:16
#oro get entity attachments
/**
* @Route("/attach", name="crm_debug_attach")
*/
public function attachAction(Request $request)
{
$this->checkAdmin();
$project = $this->getEntityManager()->getRepository(Project::class)->find(65);