Frontend
Backend
Frameworks de PHP
CMS
Mobile
Servidores
Edição de imagem e vídeo
Modelagem 3d
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from cProfile import Profile | |
import pstats | |
def profile(sort_args=['cumulative'], print_args=[10]): | |
profiler = Profile() | |
def decorator(fn): | |
def inner(*args, **kwargs): | |
result = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### I assume you run the commands as root | |
gradle_version=2.6 | |
wget -c http://services.gradle.org/distributions/gradle-${gradle_version}-all.zip | |
unzip gradle-${gradle_version}-all.zip -d /opt | |
ln -s /opt/gradle-${gradle_version} /opt/gradle | |
printf "export GRADLE_HOME=/opt/gradle\nexport PATH=\$PATH:\$GRADLE_HOME/bin\n" > /etc/profile.d/gradle.sh | |
source /etc/profile.d/gradle.sh | |
# check installation | |
gradle -v |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
sudo yum groups install -y Development\ tools | |
sudo yum install -y cmake | |
sudo yum install -y python34-{devel,pip} | |
sudo pip-3.4 install neovim --upgrade | |
( | |
cd "$(mktemp -d)" | |
git clone https://github.com/neovim/neovim.git | |
cd neovim | |
make CMAKE_BUILD_TYPE=Release |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run \ | |
--name {{printf "%q" .Name}} \ | |
{{- with .HostConfig}} | |
{{- if .Privileged}} | |
--privileged \ | |
{{- end}} | |
{{- if .AutoRemove}} | |
--rm \ | |
{{- end}} | |
{{- if .Runtime}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -e | |
# Stop the docker daemon | |
/etc/init.d/docker stop | |
# Configure ECS Agent | |
# http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html | |
# http://docs.aws.amazon.com/AmazonECS/latest/developerguide/automated_image_cleanup.html | |
cat > /etc/ecs/ecs.config << "EOF" | |
ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION=1h |
Create file /etc/systemd/system/[email protected]
. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin
, you should use paths specific for your environment.
[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
setuid (s) | setgid (s) | sticky (t) | |
---|---|---|---|
Directory | ignored | New subfiles inherit group | Only owner of subfile can (re)move it* |
File | Executes as file owner | Executes as group | ignored |
Sticky bit can be set with chmod
as the first of four digits, or using {+,-}s
(for setuid/setgid) and {+,-}t
(for sticky). For example, to enable setuid,
chmod u+s $FILE # Add setuid to a file
chmod 4755 $FILE # Possible permissions of /bin/ping
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let drawings = canvas.drawings.controlled; | |
drawings = drawings.map(drawing =>{ | |
switch (drawing.data.type) { | |
case "f": | |
case "p": { | |
let { _id, points, rotation, x, y, width, height } = drawing.data; | |
return { id: _id, valid: true, points, rotation, x, y, width, height }; | |
} | |
case "r": { |
OlderNewer