# create a net and a subnet
i=1;
while [ $i -lt 51 ]; do
neutron net-create scalenet$i --shared;
j=0;
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
1 | |
00:01:22,064 --> 00:01:27,070 | |
I should've known that you would | |
be here, Professor McGonagall. | |
2 | |
00:01:38,290 --> 00:01:41,460 | |
Good evening, Professor Dumbledore. | |
3 |
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 | |
export KEYCLOAK_URL="http://localhost:8080" | |
export USERNAME="admin" | |
export PASSWORD="password" | |
export CLIENT_ID="admin-cli" | |
export TKN=$(curl -X POST "$KEYCLOAK_URL/auth/realms/master/protocol/openid-connect/token" \ | |
-H "Content-Type: application/x-www-form-urlencoded" \ | |
-d "username=${USERNAME}" \ |
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
package de.tdlabs.keycloak.client; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import org.keycloak.OAuth2Constants; | |
import org.keycloak.RSATokenVerifier; | |
import org.keycloak.admin.client.Keycloak; | |
import org.keycloak.admin.client.KeycloakBuilder; | |
import org.keycloak.common.VerificationException; | |
import org.keycloak.jose.jws.JWSHeader; | |
import org.keycloak.representations.AccessToken; |
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
package de.tdlabs.keycloak.client; | |
import java.util.Arrays; | |
import java.util.Collections; | |
import javax.ws.rs.core.Response; | |
import org.keycloak.OAuth2Constants; | |
import org.keycloak.admin.client.Keycloak; | |
import org.keycloak.admin.client.KeycloakBuilder; |
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
# Copying kubernetes resources accross namespaces | |
kubectl get rs,secrets -o json --namespace old | jq '.items[].metadata.namespace = "new"' | kubectl create -f - | |
kubectl get cm -o json --namespace old some-config-map | jq '.metadata.namespace = "new"' | kubectl create -f - | |
# kubectl exec in each pods | |
for pod in `kubectl get pods -o go-template --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}'`; do echo $pod date:; kubectl exec -it $pod -- date ; echo "--------------"; done |
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 | |
IMAGES=$@ | |
echo "This will remove all your current containers and images except for:" | |
echo ${IMAGES} | |
read -p "Are you sure? [yes/NO] " -n 1 -r | |
echo # (optional) move to a new line | |
if [[ ! $REPLY =~ ^[Yy]$ ]] | |
then |
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
CREATE TABLE IF NOT EXISTS `country` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`iso` char(2) NOT NULL, | |
`name` varchar(80) NOT NULL, | |
`nicename` varchar(80) NOT NULL, | |
`iso3` char(3) DEFAULT NULL, | |
`numcode` smallint(6) DEFAULT NULL, | |
`phonecode` int(5) NOT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=MyISAM DEFAULT CHARSET=latin1; |
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
import BaseHTTPServer | |
from SimpleHTTPServer import SimpleHTTPRequestHandler | |
import sys | |
import base64 | |
key = "" | |
class AuthHandler(SimpleHTTPRequestHandler): | |
''' Main class to present webpages and authentication. ''' | |
def do_HEAD(self): |
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 re 'eval'; | |
'?' | |
=~( '(' | |
.'?'. '{'. | |
('`'| '%'). | |
('[' ^'-' | |
).''. ('`'| | |
'!') .''. | |
('`'| ','). | |
(( '"')) . ( ('[')^ |
NewerOlder