Skip to content

Instantly share code, notes, and snippets.

View VladRez's full-sized avatar

Vladislav Reznikov VladRez

  • Nisum
  • San Francisco
View GitHub Profile
{
"$schema": "https://aka.ms/terminal-profiles-schema",
// Add custom actions and keybindings to this array.
// To unbind a key combination from your defaults.json, set the command to "unbound".
// To learn more about actions and keybindings, visit https://aka.ms/terminal-keybindings
"actions":
[
// Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json.
// These two lines additionally bind them to Ctrl+C and Ctrl+V.
// To learn more about selection, visit https://aka.ms/terminal-selection
import org.apache.commons.codec.binary.Base64
import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream
import org.apache.commons.io.IOUtils
import javax.crypto.Cipher
import javax.crypto.CipherInputStream
import javax.crypto.NoSuchPaddingException
import javax.crypto.spec.IvParameterSpec
import javax.crypto.spec.SecretKeySpec
import java.nio.charset.StandardCharsets
docker run \
-it --rm --user "$(id -u):$(id -g)" \
-v "$PWD":/usr/src/app -w /usr/src/app rails \
rails new mastership -d=postgresql -T --webpack=react \
--skip-coffee --skip-bundle --skip-turbolinks --skip-spring
docker run \
-it --rm --user "$(id -u):$(id -g)" \
-v "$PWD":/usr/src/app -w /usr/src/app rails \
rails new . --api -T --skip-bundle
@VladRez
VladRez / Dockerfile
Created March 16, 2020 14:20
tomcat server docker bootstrap to avoid 404 and 403 error
FROM tomcat:9.0
RUN mv webapps webapps.bk
RUN mv webapps.dist/ webapps
COPY /tomcat-users.xml /usr/local/tomcat/conf/
COPY /context.xml /usr/local/tomcat/webapps/manager/META-INF/
CMD ["catalina.sh", "run"]
+ `sudo heroku container:pull <SERVICE> --app <APPNAME>` - pull container
+ `sudo heroku container:rm <SERVICE> --app <APPNAME>` - remove service
+ `sudo heroku container:push <SERVICE> --recursive --app <APPNAME>` - build and push multiple services
+ `sudo heroku container:release <SERVICE> --app <APPNAME>` - enable heroku service
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
repos=(repo1 repo2 repo3 etc)
for i in "${repos[@]}";do curl -X PATCH -H "Authorization: token YOURTOKEN" https://api.github.com/repos/YOURUSERNAME/$i -d '{"private":true}';done
@VladRez
VladRez / gist:81ec83d3342d2d7fc0dedf9e22fd0d0c
Created September 7, 2019 18:14
remove file from git tracking
git rm --cache docker-compose.yml
#!/bin/bash
for DIRNAME in $(find ./ -type d)
do
mv $DIRNAME $(echo $DIRNAME | sed -E 's/FIND/REPLACE/')
done
#!/bin/bash
curl -u "$1" https://api.github.com/user/repos -d "{\"name\":\"$2\"}"
git init
git remote add origin "https://github.com/$1/$2.git"
touch README.md
echo 'cli-push-remote-repo.sh' >> .gitignore
echo '.gitignore' >> .gitignore