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 static void main( String[] args ) { | |
/* | |
* Manifest Dependencies used for this example. | |
* | |
* org.eclipse.emf, | |
* org.eclipse.emf.common, | |
* org.eclipse.emf.ecore, | |
* org.eclipse.emf.ecore.edit, | |
* org.eclipse.emf.ecore.xmi, |
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 | |
ROOT=/data/test | |
for f in $ROOT/my_dir/*.mkv | |
do | |
# Display progress information | |
echo "Processing $f..." | |
date | |
# Remove the file extension (here, .mkv) |
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
// Include our plug-ins | |
var gulp = require('gulp'); | |
var bowerMain = require('bower-main'); | |
var mainBowerFiles = require('main-bower-files'); | |
var exists = require('path-exists').sync; | |
var gulpIgnore = require('gulp-ignore'); | |
// Create some task | |
gulp.task( 'copy-bower-dep', function() { |
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
:: The password candidates. | |
:: FIXME: read them from a file. | |
set list="pwd1" "pwd2" "pwd3" "pwd4" | |
:: Assumption: there is only one RAR file in the directory. | |
:: FIXME: iterate over a list of files? | |
:: The script stops as soon as an extraction succeeds. | |
FOR %%A IN (%list%) DO ( | |
echo "Testing %%A..." |
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
package whatever; | |
import static org.ops4j.pax.exam.CoreOptions.mavenBundle; | |
import static org.ops4j.pax.exam.CoreOptions.systemProperty; | |
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.configureSecurity; | |
import java.io.ByteArrayOutputStream; | |
import java.io.File; | |
import java.io.PrintStream; | |
import java.security.PrivilegedActionException; |
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 | |
# Configuration | |
DL_DIR="/wherever/you/want" | |
INPUT="/wherever/is/your/file" | |
# We need "youtube-dl" (https://github.com/rg3/youtube-dl). | |
# We here download the best video quality. | |
# One Youtube address per line. Empty lines are ignored. | |
mkdir -p $DL_DIR && cd $DL_DIR |
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
package whatever; | |
import java.io.File; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.HashSet; | |
import org.apache.maven.artifact.Artifact; | |
import org.apache.maven.artifact.DefaultArtifact; | |
import org.apache.maven.artifact.handler.DefaultArtifactHandler; |
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
// Include our plug-ins | |
var gulp = require('gulp'); | |
var mainBowerFiles = require('main-bower-files'); | |
var exists = require('path-exists').sync; | |
// Create some task | |
gulp.task( 'copy-bower-dep', function() { | |
// Replace files by their minified version when possible | |
var bowerWithMin = mainBowerFiles().map( function(path, index, arr) { |
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/sh | |
# Assuming we have an Elastic Search cluster secured by Nginx. | |
################# | |
# On the server. | |
################# | |
# Capture HTTP traffic to Nginx (listening on port 9200). | |
# Output the result in a PCAP file, readable with Wireshark. |
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/sh | |
# Let's assume you have an OVF image exported from VMWare | |
# (the *.ovf descriptor, *.vmdk, *.mf and *.nvram files) | |
# that you want to deploy on Openstack. | |
# An OVA file is a TAR archive that wraps all this file structure. | |
BASE_NAME="sample" | |
tar -cf "${BASE_NAME}.ova" "${BASE_NAME}.ovf" "${BASE_NAME}.mf" "${BASE_NAME}-1.vmdk" |
OlderNewer