This file contains 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
import os | |
import stat | |
import shutil | |
import subprocess | |
# protected folders in /home | |
DONT_DELETE = 'Department lost+found someguy'.split() | |
def chmod_writable(func, path, excinfo): |
This file contains 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
# mkalias name "command param1 param2 etc.." | |
# Example: mkalias srvfolder "python -m SimpleHTTPServer" | |
mkalias () { | |
echo "alias $1=\"$2\"" >> ~/.bashrc | |
} |
This file contains 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
import subprocess | |
command = subprocess.Popen( ["-c", "who | cut -d' ' -f1 | sort | uniq | grep -v root" ], stdout=subprocess.PIPE, shell=True ) | |
users, err = command.communicate() |
This file contains 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
DOMAIN_NAME="domain-name" | |
DOMAIN_USER='domain-user' | |
DOMAIN_PASS='...pass..' | |
# USAGE: | |
# rd ( hostname | ip ) | |
# rd winserver | |
# rd 10.0.0.4 | |
rd() |
This file contains 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
# append this to /var/opt/gitlab/nginx/conf/gitlab-http.conf | |
location ~ ^/(uploads)/ { | |
expires max; | |
add_header Cache-Control public; | |
} |
This file contains 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
section: screens | |
# two hosts named: desktop and laptop | |
# These are the nice names of the hosts to make it easy to write the config file | |
# The aliases section below contain the "actual" names of the hosts (their hostnames) | |
laptop: | |
desktop: | |
end | |
section: links | |
desktop: |
This file contains 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
<?php | |
namespace Cid\FrontBundle\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
use Symfony\Component\Validator\Constraints as Assert; | |
/** | |
* Solicitud | |
* |
This file contains 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
{ | |
"name": "symfony/framework-standard-edition", | |
"description": "The \"Symfony Standard Edition\" distribution", | |
"autoload": { | |
"psr-0": { "": "src/" } | |
}, | |
"require": { | |
"php": ">=5.3.3", | |
"symfony/symfony": "2.1.*", | |
"doctrine/orm": ">=2.2.3,<2.4-dev", |
This file contains 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
section: screens | |
laptop: | |
desktop: | |
end | |
section: links | |
desktop: | |
right = laptop | |
# Desktop1 is to the right of Laptop |
This file contains 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/bash | |
backup_number=8 | |
base_name="backup.gz" | |
backup_path="/opt/somebackup/" | |
cd $backup_path | |
# clean any old temp backup |
OlderNewer