Skip to content

Instantly share code, notes, and snippets.

View skarllot's full-sized avatar
💭
I may be slow to respond.

Fabrício Godoy skarllot

💭
I may be slow to respond.
View GitHub Profile
@skarllot
skarllot / rescan.sh
Created January 31, 2014 19:21
Force the rescan of partition to get the kernel aware of the new size
echo 1 > /sys/block/sda/device/rescan
# Reference: http://blog.gurudelleccelsopicco.org/2009/09/online-lun-expansion-and-partition-resizing-without-reboot-under-linux/
@skarllot
skarllot / rc.local
Last active August 29, 2015 13:55
Turn available apache directory, that is outside of chroot, to VSFTPD user
. . .
mount -o bind,rw,acl /var/www/[page-directory] /var/vsftpd/[user]/www
@skarllot
skarllot / mount-vss.bat
Created February 7, 2014 13:04
Assign a mount point-like to Volume Shadow Copy
:: List available shadows
diskshadow
list shadows all
:: Create a symbolic link to shadow
mklink /d C:\SHADOW01 \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\
@skarllot
skarllot / fstab
Last active August 29, 2015 13:56
Mount network volume (NFS, iSCSI, OCFS, GFS etc)
. . .
/dev/foo1 /foo ocfs2 _netdev 0 0
# _netdev
# Ensures that the OCFS2 volume is not mounted before the networking
# structure is up, and ensures that there is an unmount before shutting down
# the network.
# http://pic.dhe.ibm.com/infocenter/lnxinfo/v3r0m0/index.jsp?topic=%2Fliaag%2Focfs2%2Fl0wocf00_ocfs2_mounting_shared_devices.htm
@skarllot
skarllot / docker.sh
Last active August 29, 2015 13:58
Docker commands
# Get deployed containers
docker ps -a
# Get container details (FULL-ID, IP etc)
docker inspect [ID] | less
# Get a bash session on container
lxc-attach -n [FULL-ID] /bin/bash
# Remove untagged images
@skarllot
skarllot / dock-attach.sh
Last active August 29, 2015 13:58
Docker attach replacement to old Dockers
dock_attach() {
lxc-attach -n $(sudo docker inspect $1 | grep '"ID"' | sed 's/[^0-9a-z]//g') /bin/bash
}
alias dock-attach=dock_attach
#Ref: https://github.com/dotcloud/docker/issues/1228#issuecomment-31872991
@skarllot
skarllot / get_install_date.bat
Created April 9, 2014 19:30
Get Windows install date
systeminfo | find /i "original"
@skarllot
skarllot / get_install_date.sh
Created April 10, 2014 18:41
Get Linux install date
last | grep "wtmp"
@skarllot
skarllot / httpd.conf
Last active August 29, 2015 14:00
Improve Apache SSL security
<VirtualHost *:443>
# (...)
SSLProtocol ALL -SSLv2 -SSLv3
SSLHonorCipherOrder On
SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS
Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains"
# (...)
# References:
# - https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
@skarllot
skarllot / st
Created May 7, 2014 01:40
Simple script to integrate swift tool (st) with Cloudfuse configuration
#!/usr/bin/python -u
# Copyright (c) 2010-2011 OpenStack, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software