PHP: Disable Xdebug for CLI
In most scenarios you won’t need Xdebug on your CLI. Also it is recommended to disable it if you use Composer . sudo php5dismod -s cli xdebug
In most scenarios you won’t need Xdebug on your CLI. Also it is recommended to disable it if you use Composer . sudo php5dismod -s cli xdebug
In case your template is not located in a file but in the database Twig allows you to render a string: $twig_env = new Twig_Environment(new Twig_Loader_String); $output = $twig_env->render('This is {{ foo }}', [ 'foo' => 'an ordinary string', ]); // $output now contains: This is an ordinary string
If you want to destroy all data on a device use the following command. shred is part of the coreutils package. /usr/bin/shred -v -f /dev/sda Data destroyed by shred can’t be restored unless you invest a lot of time and use special equipment. Use with caution. The option -n can be used to increase the amount of iterations (default: 3).
In case the URL of your remote git repository has changed, update your local repository as follows: git remote set-url origin git@server:path/to/repository.git
If your system does not boot up und you’re dropped to an initramfs shell after “waiting for root filesystem” fails – check your mdadm config /etc/mdadm/mdadm.conf Make sure it contains the correct definitions which are available with mdadm --detail --scan Adjust your config and run update-initramfs -u -k all to make the system bootable again.
Once in a while it might happen to you that you attempt to boot some Debian machine and some fsck errors occur. Debian will then present you a maintenance shell and ask for your root password. There are two options at this point: Enter your root password or hit CTRL-D to continue. Continuing will not resolve the problem as the fsck error needs to be fixed manually. If you don’t know your root password or you’re just to lazy to type in a 30 character string the following might help....
In case an IP gets banned by fail2ban and you want to remove it: The following command gives you an overview of all chains and the banned IPs along with their corresponding number. iptables -L -n --line-numbers To unban an IP use this command with the correct chain and number: iptables -D fail2ban-ssh 2 Another method is the usage of fail2ban-client: fail2ban-client set sasl unbanip IP
Virtualmin/Webmin ships with a self-signed SSL certificate. In case you want to generate a new one, here’s how: openssl rsa -in webmin.key -out webmin.pem openssl req -new -key webmin.key -out webmin.csr openssl x509 -req -days 1095 -in webmin.csr -signkey webmin.key -out webmin.crt cat webmin.crt >> webmin.pem cd /etc/webmin/ cp miniserv.pem miniserv.pem.bak cp /root/ssl/webmin.pem miniserv.pem service webmin restart
First: Make sure to shut down the virtual machine or to unmount the disk inside it. Once finished you can start to extend the logical volume on the hypervisor: lvextend -L+400G /dev/vg0/disk e2fsck -f /dev/vg0/disk resize2fs /dev/vg0/disk There might be a chance you need kpartx, growpart (provided by cloud-guest-utils) followed by resize2fs to grow the mounted partition. In case you shut down the virtual machine you may start it again with...
If you ever manually remove files from a git repository you have to tell git they have been removed and add the files to the index to commit the changes afterwards: for FILE in $(git ls-files --deleted);do git rm $FILE;done