Skip to content

Instantly share code, notes, and snippets.

View fgbreel's full-sized avatar

Gabriel Francisco fgbreel

View GitHub Profile
@fgbreel
fgbreel / addsftpuser.sh
Created January 11, 2012 19:53
Script para criar usuários de sftp.
#!/bin/bash
user=$1
if useradd -G sftponly -s /bin/false -m ${user}
then
mkdir -p /chroot/${user}/home/${user}
chown ${user}.root /chroot/${user}/home/${user}
cp -pr /etc/skel/* /chroot/${user}/
chown root.root /chroot/${user}
@fgbreel
fgbreel / delorean.sh
Created April 6, 2012 04:23
Script de backup
#!/bin/bash
today=$(date '+%Y-%m-%d')
pathdst=/Volumes/backup/bkp-${today}
pathsrc=/Users/gabrielfrancisco/Documents
lastbkp=/Volumes/backup/lastbkp
rsync -avrP --link-dest=${lastbkp} $pathsrc $pathdst
unlink ${lastbkp}
@fgbreel
fgbreel / sshd_conf.sh
Created November 19, 2012 16:50
SFTP with OpenSSH
Subsystem sftp "internal-sftp -u 0002"
Match Group sftponly
ChrootDirectory %h
AllowTCPForwarding no
X11Forwarding no
ForceCommand internal-sftp -u 0002
@fgbreel
fgbreel / to-remember.sh
Last active December 15, 2015 07:38
Something to remember when compile samba 4
./configure --with-aio --enable-debug
needs:
build-essential libacl1-dev libattr1-dev libkrb5-dev libaio-dev python2.7-dev dmapi-dev \
libdmalloc-dev libdmapsharing-3.0-dev libldap2-dev libreadline-dev libpam-dev libsasl2-dev \
libgnutls-dev libncurses5-dev lintian libctdb-dev libavahi-common-dev libavahi-client-dev \
libtalloc-dev python-ldb-dev xsltproc
@fgbreel
fgbreel / dmesg-human.pl
Last active December 16, 2015 10:49
Make human readable dmesg dates.
#!/usr/bin/perl
use strict;
use warnings;
my @dmesg_new = ();
my $dmesg = "/bin/dmesg";
my @dmesg_old = `$dmesg`;
my $now = time();
my $uptime = `cat /proc/uptime | cut -d"." -f1`;
#!/usr/bin/env perl
use strict;
use warnings;
use Fcntl;
my $filename = '/var/log/maillog';
#my $sqltemp = '/tmp/.sqltemp-emails.sql';
my %hash = ();
my $data;
@fgbreel
fgbreel / start-stop-template.sh
Created November 7, 2013 18:12
Start/Stop template
#!/bin/bash
### BEGIN INIT INFO
# Provides: fucking
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the fucking daemon
# Description: starts fucking daemon using start-stop-daemon
@fgbreel
fgbreel / vhost.sh
Last active December 28, 2015 00:19
vhost apache
<VirtualHost *:443>
# hostname, URL.
ServerName placeholder.com.br
# local dos arquivos do site.
DocumentRoot /var/www/placeholder
# log de erro e acesso do servidor web.
ErrorLog ${APACHE_LOG_DIR}/placeholder.com.br-error
CustomLog ${APACHE_LOG_DIR}/placeholder.com.br-access combined

Keybase proof

I hereby claim:

  • I am fgbreel on github.
  • I am fgbreel (https://keybase.io/fgbreel) on keybase.
  • I have a public key whose fingerprint is 24AE E505 ED71 C671 3634 7DE7 F48D 97DE E707 556B

To claim this, I am signing this object: