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
var foo = 0; | |
db.collection.find().forEach( function(doc) { doc.slug = (++foo).toString(); db.collection.save(doc); } ) |
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
[Unit] | |
Description=MongoDB Monitoring Agent | |
After=network.target remote-fs.target nss-lookup.target | |
[Service] | |
Type=simple | |
ExecStart=/usr/bin/python /var/lib/mmsagent/mms-agent/agent.py | |
Restart=always | |
User=mmsagent |
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 headers { | |
wget -O /dev/null -S -q $1 | |
} |
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
/** | |
* Provides methods to determine minimum the number of cuts | |
* required to split a string into palindromes. | |
* | |
* @author Scott Rossillo | |
*/ | |
public final class Partitioner { | |
/** |
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
<code_scheme name="Wildfly"> | |
<option name="LINE_SEPARATOR" value=" " /> | |
<option name="INSERT_INNER_CLASS_IMPORTS" value="true" /> | |
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="9999" /> | |
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="9999" /> | |
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND"> | |
<value> | |
<package name="org.junit.Assert" withSubpackages="false" static="true" /> | |
<package name="org.rendersnake.HtmlAttributesFactory" withSubpackages="false" static="false" /> | |
<package name="org.mockito.Mockito" withSubpackages="true" static="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
files: | |
/opt/elasticbeanstalk/hooks/appdeploy/post/10_docker_nat.sh: | |
mode: "000755" | |
owner: root | |
group: root | |
content: | | |
#!/bin/bash | |
set -u # Fail on unset variables | |
set -e # Fail if any command fails | |
PATH="$PATH:/sbin:/usr/bin" |
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
public int countClumps(int[] nums) { | |
int clumps = 0; | |
int last = -1; | |
int run = 0; | |
for(int i = 0; i< nums.length; i++) { | |
if (last == nums[i]) { | |
if(run < 1) { | |
clumps++; | |
} | |
run++; |
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 | |
# Install Docker and mult-arch dependencies | |
sudo apt-get install binfmt-support qemu-user-static | |
sudo apt-get install docker.io | |
sudo usermod -aG docker $USER | |
sudo reboot |
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 | |
# Install buildx for arm64 and enable the Docker CLI plugin | |
sudo apt-get install jq | |
mkdir -p ~/.docker/cli-plugins | |
BUILDX_URL=$(curl https://api.github.com/repos/docker/buildx/releases/latest | jq -r '.assets[].browser_download_url' | grep arm64) | |
wget $BUILDX_URL -O ~/.docker/cli-plugins/docker-buildx | |
chmod +x ~/.docker/cli-plugins/docker-buildx |
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
$ docker buildx create --name mbuilder | |
mbuilder | |
$ docker buildx use mbuilder | |
$ docker buildx inspect --bootstrap | |
Name: mbuilder | |
Driver: docker-container | |
Nodes: |
OlderNewer