Skip to content

Instantly share code, notes, and snippets.

View mrsombre's full-sized avatar

Dmitrii Barsukov mrsombre

  • Montenegro
  • 12:21 (UTC +02:00)
View GitHub Profile
@mrsombre
mrsombre / awscli.sh
Created September 29, 2022 13:15
AWS
# list instancess with ip
aws ec2 describe-instances --filters "Name=tag:Team,Values=Tools" --query 'Reservations[*].Instances[*].{Instance:InstanceId,Name:Tags[?Key==`Name`]|[0].Value,IP:PrivateIpAddress}'
@mrsombre
mrsombre / linux.sh
Last active September 29, 2022 12:45
Linux commands
## delete files
# rm indexed
rm a_{000750..000850}
# delete old
find . -type f -mtime +30 -delete
# delete by size
find . -type f -size 1k -delete
# delete dir
find . -depth -mtime +30 -execdir rm -rf {} +
@mrsombre
mrsombre / commands.sh
Last active December 24, 2021 09:41
Remove git tags
# local
git tag -d <tag_name>
# remote
git push --delete origin tagname
# Delete all local tags and get the list of remote tags:
git tag -l | xargs git tag -d
git fetch
# Remove all remote tags
git tag -l | xargs -n 1 git push --delete origin
@mrsombre
mrsombre / github-api.md
Last active December 1, 2021 06:49
Validate github token
curl -H "Authorization: token OAUTH-TOKEN" https://api.github.com/users/codertocat -I
@mrsombre
mrsombre / _wsl.md
Last active April 2, 2021 03:57
WSL 2 Scripts and Hacks

A set of Hacks and scripts for WSL2 Ubuntu distro

@mrsombre
mrsombre / centos
Last active March 16, 2020 00:19
CentOS VirtualBox install
=== Symlink Support in Windows
The first step is installing Polsedit - User Policies Editor. When you open it, look for Create symbolic links.
http://www.southsoftware.com/polsedit.zip
Double click the row, click Add User or Group... and look for your username in the list.
Closing the app will automatically save your choices, and you'll need to reboot your machine.
=== Updating fresh system
;; Edit /etc/yum.conf and set installonly_limit: 2
yum upgrade
reboot
@mrsombre
mrsombre / xdebug.md
Last active November 19, 2019 07:01
PHP XDebug configuration

Enable xdebug in CLI for phpstorm

export PHP_IDE_CONFIG="serverName={SERVER NAME IN PHP STORM}"
export XDEBUG_CONFIG="remote_host={YOUR_IP} idekey=PHPSTORM"
@mrsombre
mrsombre / snippets.sh
Last active March 14, 2019 04:41
Useful snippets
# MySQL config files
/usr/sbin/mysqld --verbose --help | grep -A 1 "Default options"
# composer install
curl -sSL https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
@mrsombre
mrsombre / github.md
Created November 23, 2018 09:33
Github Contribute

Step 1

  • Fork project
  • git remote add upstream git@github.com:<project>.git

Step 2

git checkout master
git pull upstream master
git push origin master

How to start powershell in admin mode

  • Create shortcut for powershell
  • Set windows size Maximized
  • Set Advanced -> Run as administrator
  • Target line: %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -NoExit -ExecutionPolicy Unrestricted -Command "cd C:\WebDev"