Skip to content

Instantly share code, notes, and snippets.

@vandewilly
vandewilly / noip2.service
Created May 1, 2020 16:45 — forked from NathanGiesbrecht/noip2.service
Systemd Service file for no-ip.com dynamic ip updater
# Simple No-ip.com Dynamic DNS Updater
#
# By Nathan Giesbrecht (http://nathangiesbrecht.com)
#
# 1) Install binary as described in no-ip.com's source file (assuming results in /usr/local/bin)
# 2) Run sudo /usr/local/bin/noip2 -C to generate configuration file
# 3) Copy this file noip2.service to /etc/systemd/system/
# 4) Execute `sudo systemctl daemon-reload`
# 5) Execute `sudo systemctl enable noip2`
# 6) Execute `sudo systemctl start noip2`
take an array and print non over lapping in order pairs. example:
[1,2,3,4] => input
output below is in order combination
# (1234)
# (1)(234)
# (1)(23)(4)
Suppose you have a matrix in the form of a 2 dimensional array.
Write a method to read the rows of the matrix alternatively from right to left, left to right so on and return them as a 1 dimensional array.
for eg:
1 2 3
4 5 6
7 8 9
should return 1 2 3 6 5 4 7 8 9
You are given an array with duplicates.
You have to sort the array with decreasing frequency of elements.
If two elements have the same frequency, sort them by their actual value in increasing order.
Ex: [2 3 5 3 7 9 5 3 7]
Output: [3 3 3 5 5 7 7 2 9]

Keybase proof

I hereby claim:

  • I am vandewilly on github.
  • I am vandewilly (https://keybase.io/vandewilly) on keybase.
  • I have a public key whose fingerprint is C9D4 F0F5 7071 C3D2 E050 2A42 A1AC 7B3B 9BD2 B7BD

To claim this, I am signing this object:

sysctl net.ipv4.ip_forward=1
iptables -t nat -A PREROUTING -p tcp --dport 443 -j DNAT --to-destination 172.17.0.2:443
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 172.17.0.2:80
iptables -t nat -A POSTROUTING -j MASQUERADE
docker kill $(docker ps -q)
@vandewilly
vandewilly / gist:6794191
Created October 2, 2013 13:56
Deploying a java app with curl
curl -T "MyApp.war" "http://manager:manager@localhost:8080/manager/text/deploy?path=/MyApp&update=true"
@vandewilly
vandewilly / gist:4252880
Created December 10, 2012 19:51 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt