Skip to content

Instantly share code, notes, and snippets.

View shadyueh's full-sized avatar
🏠
Working from home

Held Grijo shadyueh

🏠
Working from home
View GitHub Profile
gs -sOutputFile=outfile.pdf -sDEVICE=pdfwrite \
-sColorConversionStrategy=Gray -dProcessColorModel=/DeviceGray \
-dCompatibilityLevel=1.4 infile.pdf < /dev/null
# check if docker socket exists
ls -la /var/run/docker.sock
# add current user to docker group
sudo chown $USER:docker /var/run/docker.sock
<?php
$date = new DateTime('now');
$date->modify('first day of this month');
echo $date->format('Y-m-d');
$date->modify('last day of this month');
echo $date->format('Y-m-d');
@shadyueh
shadyueh / linux_commands.sh
Created August 17, 2021 12:35
Comandos uteis
# listar portas abertas
sudo lsof -i -P -n | grep LISTEN
@shadyueh
shadyueh / import.md
Created June 21, 2021 17:10 — forked from iamstoick/import.md
How to import database in MySQL in Docker?

This is a simple way of importing MySQL database in Docker.

  1. In you Dockerfile you must have a shared folder. Shared folder is a directory in your host machine that is mounted to Docker instance.

  2. Put the exported sql file in the shared folder.

  3. Login to your Docker instance via docker exec -it DOCKER_CONTAINER_ID bin/bash.

  4. Login to MySQL via mysql -u USERNAME -p.

@shadyueh
shadyueh / ssh.sh
Created April 9, 2021 05:02 — forked from zircote/ssh.sh
Convert a AWS PEM into a ssh pub key
ssh-keygen -y -f private_key1.pem > public_key1.pub
export http_proxy=http://<proxy>:<port>
export https_proxy=http://<proxy>:<port>
sudo -E add-apt-repository ppa:webupd8team/java
#!/bin/bash
# Add spotify gpg behind proxy
sudo apt-key adv --keyserver keyserver.ubuntu.com --keyserver-options http-proxy=http://proxy.com:port --recv-keys 0DF731E45CE24F27EEEB1450EFDC8610341D9410