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
# discover which container is using a volume | |
docker ps -a --filter volume=<VOLUME_NAME_OR_ID> |
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
## check config of systemd-resolved | |
systemd-analyze cat-config systemd/resolved.conf | |
## Show systemd folders | |
systemd-analyze unit-paths |
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
set @salt=substr(md5(concat('salt',CURRENT_TIME)),1,5) | |
set @pass='pass'; | |
set @user="root"; | |
update admin_user set `password`=CONCAT(SHA2(concat(@salt,@pass), 256),":",@salt,":1") WHERE `username`=@user |
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 | |
$finder = Symfony\Component\Finder\Finder::create() | |
->notPath('bootstrap/cache') | |
->notPath('storage') | |
->notPath('vendor') | |
->in(__DIR__) | |
->name('*.php') | |
->ignoreDotFiles(true) | |
->ignoreVCS(true); |
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
# | |
# Stop services on port 80 and 8080 before do that | |
# | |
export ARCH=amd64 | |
export K8S_VERSION=$(curl -sS https://storage.googleapis.com/kubernetes-release/release/stable.txt) | |
docker run -d \ | |
--volume=/:/rootfs:ro \ | |
--volume=/sys:/sys:rw \ |
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 | |
#permite o desenvolvimento de módulos sem que os mesmos tenham sido instalados via composer ainda. | |
$composerFiles = glob(__DIR__ . "*/*/*/composer.json"); | |
$classLoader = null; | |
foreach ($composerFiles as $composerFile) { | |
$json = json_decode(file_get_contents($composerFile), true); | |
if (!isset($json['autoload'])) { | |
throw new Exception("Autoload not found on {$composerFile}"); |
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
#!/bin/bash | |
# Config | |
N2CHROOT=~victor/tmp/n2chroot | |
export JAIL=/var/www/chroot | |
function create_chroot { | |
# Create devices | |
mkdir $JAIL/dev | |
mknod -m 0666 $JAIL/dev/null c 1 3 |
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
(function () { | |
var Multiselect = { | |
move: function (from, to) { | |
while (from.selectedIndex > -1) { | |
var option = from.options[from.selectedIndex]; | |
to.appendChild(option); | |
} | |
}, | |
moveAll: function (from, to) { | |
while (from.options.length > 0) { |
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
#first stop current mysql server | |
sudo service mysqld stop | |
#start mysqld_safe without grant and networking[security reason] in background | |
sudo mysqld_safe --skip-grant-tables --skip-networking & | |
#login as root | |
mysql -uroot |
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
################################## | |
# ~/.ssh/config | |
################################## | |
Host bitbucket.org | |
Hostname altssh.bitbucket.org | |
Port 443 |
NewerOlder