Skip to content

Instantly share code, notes, and snippets.

Get container IP

docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_name_or_id

clear build cache

My Linux Cheatsheet

Check port

(echo >/dev/tcp/{host}/{port}) &>/dev/null && echo "open" || echo "close"

Example:

$ (echo >/dev/tcp/localhost/80) &>/dev/null && echo "open" || echo "close"
/* Ver parametros de entrada y salida del SP */
sp_help 'mystored'
/* Ver código del SP */
sp_helptext 'mystored'
```
var a = ([^\s]+)\.GetInvocationList
```
```
var invocations = $1.GetInvocationList
```
![](https://cdn.cacher.io/attachments/u/36c0f053m5ikw/ZttMD83rZn7pWGOqHN4JFEQ6QU1qTbQQ/qxmkj0fv3.png)
@zeqk
zeqk / index.html
Created February 3, 2020 23:59 — forked from maxkostinevich/index.html
Cloudflare Worker - Handle Contact Form
<!--
/*
* Serverless contact form handler for Cloudflare Workers.
* Emails are sent via Mailgun.
*
* Learn more at https://maxkostinevich.com/blog/serverless-contact-form
* Live demo: https://codesandbox.io/s/serverless-contact-form-example-x0neb
*
* (c) Max Kostinevich / https://maxkostinevich.com
*/
@zeqk
zeqk / git-overwrite-branch.sh
Created December 30, 2019 21:28 — forked from ummahusla/git-overwrite-branch.sh
Git overwrite branch with another branch
# overwrite master with contents of seotweaks branch (seotweaks > master)
git checkout seotweaks # source name
git merge -s ours master # target name
git checkout master # target name
git merge seotweaks # source name
@zeqk
zeqk / datepicker.cshtml
Created October 31, 2019 15:28 — forked from badcommandorfilename/datepicker.cshtml
C# HTML5 input date datepicker MVC Razor
<!-- How to insert a date editor in a Razor view -->
<div class="form-group">
@Html.LabelFor(model => model.Start, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.TextBoxFor(model => model.Start, new { @type="date", @class = "form-control datepicker", @Value = Model.Start.ToString("yyyy-MM-dd") } )
@Html.ValidationMessageFor(model => model.Start, "", new { @class = "text-danger" })
</div>
</div>
# create the volume in advance
```bash
docker volume create --driver local \
--opt type=none \
--opt device=/home/user/test \
--opt o=bind \
test_vol
````
# create on the fly with --mount
ARG GRAFANA_VERSION="latest"
FROM grafana/grafana:${GRAFANA_VERSION}
USER root
ARG GF_INSTALL_IMAGE_RENDERER_PLUGIN="false"
ARG GF_GID="0"
ENV GF_PATHS_PLUGINS="/var/lib/grafana-plugins"

RAM

$ free -m
$ cat /proc/meminfo