Skip to content

Instantly share code, notes, and snippets.

View nyukhalov's full-sized avatar
🚀
to infinity and beyond

Roman Niukhalov nyukhalov

🚀
to infinity and beyond
View GitHub Profile
@mriddle
mriddle / jenkins_copying_configuration.sh
Created November 9, 2012 03:13
Moving Jenkins server configuration from one server to another
ORIGINAL_JENKINS_SERVER=
ORIGINAL_SERVER_USER=
NEW_JENKINS_SERVER=
NEW_SERVER_USER=
# ON THE ORIGINAL JENKINS SERVER
ssh $ORIGINAL_SERVER_USER@$ORIGINAL_JENKINS_SERVER
cd /var/lib/jenkins/
for i in `ls jobs`; do echo "jobs/$i/config.xml";done > config.totar
@bmaeser
bmaeser / subtitle-extract.txt
Created September 2, 2011 23:25
extract subtitles from *.mkv-files on osx
lines with $ are commands
### install mkvtoolnix:
$ brew install mkvtoolnix
### list content of the mkv-file:
$ mkvmerge -i mymoviefile.mkv
### what will give you:
@ihorvorotnov
ihorvorotnov / get-social-shares
Last active October 20, 2020 12:15
Get number of shares from social platforms
Facebook*:
https://api.facebook.com/method/links.getStats?urls=%%URL%%&format=json
+ works, returns shares, likes, comments and total
Twitter:
http://urls.api.twitter.com/1/urls/count.json?url=%%URL%%&callback=twttr.receiveCount
+ v1 API but still works
Reddit:
http://buttons.reddit.com/button_info.json?url=%%URL%%
@m5m1th
m5m1th / localPorts.sh
Last active May 27, 2020 04:57
Redirect port 3080/3443 to 80/443 for local dev
#Requests from outside
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 3080
iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-ports 3443
#Requests from localhost
iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j REDIRECT --to-ports 3080
iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 443 -j REDIRECT --to-ports 3443
@owainlewis
owainlewis / ApplicationController.scala
Last active March 27, 2019 11:30
Play Framework Basic Auth Action (play, scala, basic auth)
class ControllerWithBasicAuth extends Controller {
private val WithBasicAuth = new BasicAuthAction("user", "pass")
def index = WithBasicAuth {
Ok("Correct basic auth credentials")
}
}
@ldoguin
ldoguin / CouchbaseContainer.java
Created July 26, 2016 12:26
Couchbase Container for the TestContainers project
package org.testcontainers.containers;
import com.couchbase.client.core.utils.Base64;
import com.couchbase.client.java.CouchbaseCluster;
import com.couchbase.client.java.env.CouchbaseEnvironment;
import com.couchbase.client.java.env.DefaultCouchbaseEnvironment;
import org.testcontainers.containers.traits.LinkableContainer;
import org.testcontainers.containers.wait.HttpWaitStrategy;
import java.io.DataOutputStream;