This file contains hidden or 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
| If you're having problems connecting to a Dell iDrac remote console due to Java not trusting the certificate although it's in the exception list, try this. | |
| The certificate is probably signed by a MD5 intermedia certificate, and that's disabled by default. To enable, this, you need to edit your java.security file. | |
| On Windows, this is located at C:\Program Files (x86)\Java\jre_<version-here>\lib\security\java.security | |
| You need to run your editor as Administrator to be able to modify the file. | |
| Find the line that says: | |
| # jdk.jar.disabledAlgorithms=MD2, MD5, RSA keySize < 1024 | |
| If the line starts with a #, remove the # to uncomment it. |
This file contains hidden or 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
| # If you're using multiple NICs/IPs on AWS, traffic might be sent out over one of the 2 NICs only. | |
| # And the other IP will not be usable. | |
| # | |
| # /etc/network/interfaces | |
| iface eth0 inet dhcp | |
| post-up ip route add default via <ip-of-default-gateway-of-eth0> dev eth0 tab 1 | |
| post-up ip rule add from <ip-of-eth0> tab 1 | |
| pre-down ip rule del from <ip-of-eth0> tab 1 | |
| pre-down ip route del default via <ip-of-default-gateway-of-eth0> dev eth0 tab 1 |
This file contains hidden or 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
| SELECT CONCAT(table_schema, '.', table_name), | |
| CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows, | |
| CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA, | |
| CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx, | |
| CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size, | |
| ROUND(index_length / data_length, 2) idxfrac | |
| FROM information_schema.TABLES | |
| ORDER BY data_length + index_length DESC | |
| LIMIT 20; |
This file contains hidden or 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
| When a users' password has been changed on the Active Directory, you can use this procedure to remove the user from FileVault and re-add it with his new password. | |
| sudo fdesetup remove -user username | |
| sudo fdesetup add -usertoadd username | |
| Enter the user name: adminusername | |
| Enter the password for user 'adminusername': | |
| Enter the password for the added user 'username': | |
| Where username is the username of the user you want to remove and re-add. | |
| And adminusername is the username of an administrative user. |
This file contains hidden or 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
| # show only response headers | |
| # -I | |
| # use 1.2.3.4 as the IP address when connecting to www.tom.be on port 443 | |
| # --resolve www.tom.be:443:1.2.3.4 \ | |
| # actual URL to test | |
| # https://www.tom.be/this-is-a-test/ | |
| curl -I --resolve www.tom.be:443:1.2.3.4 https://www.tom.be/this-is-a-test/ |
This file contains hidden or 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
| xdg-mime default ssh.desktop x-scheme-handler/ssh | |
| cat << EOF > ~/.local/share/applications/ssh.desktop | |
| [Desktop Entry] | |
| Version=1.0 | |
| Name=SSH Launcher | |
| Exec=bash -c '(URL="%U" HOST="\${URL:6}"; ssh \$HOST); bash' | |
| Terminal=true | |
| Type=Application | |
| Icon=utilities-terminal | |
| EOF |
This file contains hidden or 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 | |
| # | |
| # Check a websocket connection with curl. Pass URL to check as parameter. | |
| # In normal conditions, this should return a 101 (Switching protocol). | |
| # | |
| CODE=$(timeout 3 curl -s --http1.1 \ | |
| --include \ | |
| --no-buffer \ | |
| --header "Connection: Upgrade" \ |
This file contains hidden or 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
| Foreach ($Site in get-website) { | |
| Foreach ($Bind in $Site.bindings.collection) { | |
| Write-Host $Site.name ":" $Site.state ":" $Bind.Protocol ":" $Bind.BindingInformation | |
| } | |
| } | |
This file contains hidden or 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
| # Apache Rewrite all requests to lowercase URLs | |
| RewriteEngine On | |
| RewriteMap lc int:tolower | |
| RewriteCond %{REQUEST_URI} [A-Z] | |
| RewriteRule (.*) ${lc:$1} [R=301,L] |
This file contains hidden or 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
| # | |
| # use case: Reverse proxy for system that returns fully-qualified URLS in the content (eg. wsdl file) | |
| # | |
| # Requires: mod_proxy, mod_proxy_http and mod_substitute | |
| # | |
| ProxyPass / http://backend-server/Some/API/On/Some/Path/ | |
| ProxyPassReverse / http://backend-server/Some/API/On/Some/Path/ | |
| # Rewrite URLs in wsdl |