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 | |
# https://raymii.org/s/tutorials/Encrypt_and_decrypt_files_to_public_keys_via_the_OpenSSL_Command_Line.html | |
# Get the public key | |
openssl rsa -in certificate.pem -out publickey.pem -outform PEM -pubout | |
# Generate the random password file | |
openssl rand -base64 128 -out key.bin | |
# Encrypt the random key with the public keyfile |
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
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
using System.Net; | |
using System.Net.Sockets; | |
using System.IO; | |
using System.Threading; | |
namespace Tcp | |
{ |
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
#!/usr/bin/python | |
# http://www.codeproject.com/Articles/43665/ExifLibrary-for-NET | |
# http://www.exiv2.org/tags.html | |
# http://www.awaresystems.be/imaging/tiff/tifftags.html | |
import os | |
import struct | |
import random | |
import datetime | |
import sys |
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
#query scripts in rpm file | |
rpm -qp --scripts xxx.rpm | |
#extact files in .rpm file | |
rpm2cpio myrpmfile.rpm | cpio -idmv | |
# delete user from ldap | |
nbur420-332vm1:~ # ldapdelete -v -x -D "cn=admin mgr 01,dc=nbur 420 332 vm1,dc=engba,dc=xxx,dc=com" -w P@ssw0rd "uid=u5_asesxb9k16-vm544,ou=people,dc=nbur 420 332 vm1,dc=engba,dc=xxx,dc=com" | |
ldap_initialize( <DEFAULT> ) | |
deleting entry "uid=u5_asesxb9k16-vm544,ou=people,dc=nbur 420 332 vm1,dc=engba,dc=xxx,dc=com" |
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
#!/usr/bin/python | |
max_data_len = 1024000 | |
import socket, sys | |
def main(argv): | |
if len(argv) < 3: | |
usage() | |
return |
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 DiffPerByte(string path1, string path2) | |
{ | |
byte[] file1 = System.IO.File.ReadAllBytes(path1); | |
byte[] file2 = File.ReadAllBytes(path2); | |
Console.WriteLine("{0} len: {1}", path1, file1.Length); | |
Console.WriteLine("{0} len: {1}", path2, file2.Length); | |
int len = file2.Length < file1.Length ? file2.Length : file1.Length; | |
for (int i = 0; i < len; i++) | |
{ |