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 | |
| # Start a GitLab instance in docker. | |
| # Services will be available on ports 9000, 9001 and 9002. | |
| sudo docker run --detach \ | |
| --hostname localhost \ | |
| --publish 9000:80 --publish 9001:443 --publish 9002:22 \ | |
| --name gitlab \ | |
| --restart always \ |
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 json docs into mongodb: | |
| mongoimport --db mydb --collection users --file users.json | |
| # Sample file to import: | |
| {_id:NumberInt(1), title:"Text"} | |
| {_id:NumberInt(2), title:"Text"} | |
| {_id:NumberInt(3), title:"Text"} | |
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
| db.coll.aggregate( | |
| { $sample: { size: 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
| <div class="video-container"> | |
| <iframe width="560" height="315" src="https://www.youtube.com/embed/ZB-jmlA3veo" frameborder="0" allowfullscreen></iframe> | |
| </div> | |
| <style> | |
| .video-container { | |
| position:relative; | |
| padding-bottom:56.25%; | |
| padding-top:30px; | |
| height: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
| @{Layout = "~/Views/Shared/_Layout.cshtml";} | |
| @Url.Content("~/Content/Site.css") | |
| @Url.Content("~/Scripts/jquery-1.5.1.min.js") | |
| @Url.Action("Index", "Sample") | |
| @RenderBody() | |
| @Html.Partial("~/Views/...") | |
| @{ | |
| var price = 20; | |
| var weekday = DateTime.Now.DayOfWeek; |
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
| /* | |
| * How to convert File to Hex in Java | |
| * https://www.mkyong.com/java/how-to-convert-file-to-hex-in-java/ | |
| */ | |
| package sqltracereader; | |
| import java.io.File; | |
| import java.io.FileInputStream; | |
| import java.io.IOException; | |
| import java.io.InputStream; |
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 javaapplication2; | |
| import java.sql.Connection; | |
| import java.sql.DatabaseMetaData; | |
| import java.sql.DriverManager; | |
| import java.sql.ResultSet; | |
| import java.sql.ResultSetMetaData; | |
| import java.sql.SQLException; | |
| import java.sql.Statement; | |
| import java.util.logging.Level; |
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 following code will automatically send Basic Auth info in all requests. | |
| // Create the basic auth info | |
| HttpAuthenticationFeature feature = | |
| HttpAuthenticationFeature.basic( | |
| "user@domain.com", // or just "user" | |
| "password"); | |
| // create the client |
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
| # Add swap memory to a running amazon instance | |
| # Choose your swap size, in this case 4096M (4G) | |
| sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=4096 | |
| sudo /sbin/mkswap /var/swap.1 | |
| sudo chmod 600 /var/swap.1 | |
| sudo /sbin/swapon /var/swap.1 | |
| # Add the following line to /etc/fstab to enable swap at boot: |
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
| # Sample file for nginx | |
| # docker-compose up -d | |
| # docker-compose up -d --no-recreate | |
| # docker-compose stop | |
| # docker-compose rm -f | |
| web: | |
| image: nginx:alpine | |
| container_name: nginx |
OlderNewer