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 <stdio.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <errno.h> | |
#include <string.h> | |
#include <arpa/inet.h> | |
#include <linux/if.h> | |
#include <linux/if_tun.h> | |
#include <sys/socket.h> |
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
https://www.kernel.org/doc/Documentation/vfio.txt | |
root@sax13 ~]# ip link | |
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 | |
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 | |
2: ens2f0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 | |
link/ether 38:ea:a7:35:58:e0 brd ff:ff:ff:ff:ff:ff | |
3: ens2f1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 | |
link/ether 38:ea:a7:35:58:e1 brd ff:ff:ff:ff:ff:ff | |
4: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000 | |
link/ether fc:15:b4:0d:62:60 brd ff:ff:ff:ff:ff:ff |
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
cat .gtkrc-2.0 | |
include "/root/.gtkrc-2.0.mine" | |
gtk-theme-name="Adwaita" | |
gtk-icon-theme-name="Adwaita" | |
gtk-font-name="MiscFixedSC613 9" | |
gtk-cursor-theme-size=0 | |
gtk-toolbar-style=GTK_TOOLBAR_BOTH | |
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR | |
gtk-button-images=1 |
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 class Main { | |
public static void main(String[] args) { | |
Main m = new Main(); | |
TestClassIface t1 = m.load("test/1.jar"); | |
TestClassIface t2 = m.load("test/2.jar"); | |
t1.execute(); | |
t2.execute(); | |
} | |
TestClassIface load(String path) { | |
try { |
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 class Main { | |
public static void main(String[] args) { | |
load("test/1.jar"); | |
load("test/2.jar"); | |
} | |
private static void load(String path) { | |
try { | |
ClassLoader cl = new URLClassLoader(new URL[] { new File(path).toURL()}); |
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
type section = { | |
idx : int; | |
link : int; | |
mutable name : string; | |
offset : int; | |
name_offset : int; | |
entsize : int | |
};; |
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
qemu-nbd --connect=/dev/nbd1 CentOS-7-x86_64-GenericCloud.qcow2 | |
mount /dev/nbd1p1 /mnt/ | |
sed -i -e 's/root:!!:/root::/g' /mnt/etc/shadow | |
rm /mnt/etc/sysconfig/network-scripts/ifcfg-eth0 | |
umount /mnt/ | |
qemu-nbd -d /dev/nbd1 |
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
truncate -s 1M cloudconfig.img | |
/usr/sbin/mkfs.vfat -n config-2 cloudconfig.img | |
mmd -i cloudconfig.img ::openstack | |
mmd -i cloudconfig.img ::openstack/latest | |
mcopy -i cloudconfig.img meta_data.json network_data.json ::openstack/latest |
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
//avro-tools.jar needed | |
Schema schema = new Schema.Parser().parse(new File("/data/work/avro/message.avro")); | |
DatumReader<GenericRecord> dr = new GenericDatumReader<GenericRecord>(schema); | |
InputStream in = new FileInputStream(new File("/data/work/avro/record_pack/record_1_202571858.bin")); | |
BinaryDecoder decoder= DecoderFactory.get().binaryDecoder(in, null); | |
GenericRecord out = dr.read(null, decoder); | |
System.out.println(out); |
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 org.tom; | |
import com.tailf.jnc.*; | |
import java.io.IOException; | |
public class Main { | |
static void dumpNode(Element e, String pad) { | |
Element n = e.getChild("name"); | |
if (n != null) { |
OlderNewer