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
| """ | |
| The most atomic way to train and inference a GPT in pure, dependency-free Python. | |
| This file is the complete algorithm. | |
| Everything else is just efficiency. | |
| @karpathy | |
| """ | |
| import os # os.path.exists | |
| import math # math.log, math.exp |
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
| Byobu Commands | |
| ============== | |
| byobu Screen manager | |
| Level 0 Commands (Quick Start) | |
| ------------------------------ | |
| <F2> Create a new window |
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
| Producer | |
| Setup | |
| bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test-rep-one --partitions 6 --replication-factor 1 | |
| bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test --partitions 6 --replication-factor 3 | |
| Single thread, no replication | |
| bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test7 50000000 100 -1 acks=1 bootstrap.servers=esv4-hcl198.grid.linkedin.com:9092 buffer.memory=67108864 batch.size=8196 |
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
| #!/usr/bin/env python | |
| """ | |
| volume_transfer_cleanup.py | |
| Script to update provider_auth (CHAP username and secret) for transferred | |
| volumes, for now it only works for volume hosted on SolidFire. | |
| related bug: https://launchpad.net/bugs/1349475 | |
| Usage: volume_transfer_cleanup --mode={readonly, write} | |
| If you only want to find out corrupted records without updating them, set | |
| mode to readonly (the default value), e.g |
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/sh | |
| ALL_OPTS=`egrep -e '^#?\w*\s?=' etc/cinder/cinder.conf.sample|sed 's/#//g'|sed 's/=/ /g'|awk '{print $1}'|sed 's/\n/ /g'` | |
| for i in $ALL_OPTS; | |
| do | |
| #RES=`find cinder -type f -name "*.py" ! -path "cinder/tests/*" -exec egrep -l "CONF.$i|configuration.$i" {} \; | sort -u` | |
| RES=`egrep -l --include '*.py' --mmap "CONF.$i|configuration.$i|conf.$i" * -rn` | |
| if [ $? -eq 1 ]; then | |
| echo $i is unused | |
| UNUSED=`echo $UNUSED $i` |
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 | |
| # Script to detect untracked objects in Swift, it's been tested against | |
| # Grizzly Swift (keystone as auth) without problem | |
| # It could take very LONG time (several minutes ~ hours) if there are lots of | |
| # objects. | |
| # | |
| # This script must be run on storage nodes | |
| # Prerequisites: | |
| # - have access to object directory | |
| # - swift client is installed |
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
| # Openstack API | |
| ## Keystone | |
| http http://localhost:5000/v2.0/tokens auth:='{"passwordCredentials":{"username": "demo", "password":"pass"}, "tenantId":"f24d505c225641a3a728319a166db960"}' | |
| ## Cinder | |
| http POST http://localhost:8776/v1/5d36abf49d654799b843e2c010e10649/volumes X-Auth-Token:'65d175eb2899496f8f948e113d06e537' volume:='{"display_name":"foo", "size": 1}' | |
| http GET http://localhost:8776/v1/dff93e4df7354ac283f8f957a10c1caa/volumes X-Auth-Token:'da3c04fee49f442e8c934692c90468f3' |