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 <string.h> | |
#include <stdlib.h> | |
#include <ctype.h> | |
#include <openssl/rsa.h> | |
#include <openssl/engine.h> | |
#include <openssl/pem.h> | |
// I'm not using BIO for base64 encoding/decoding. It is difficult to use. | |
// Using superwills' Nibble And A Half instead |
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
/* | |
* An implementation of convertion from OpenSSL to OpenSSH public key format | |
* | |
* Copyright (c) 2008 Mounir IDRASSI <[email protected]>. All rights reserved. | |
* | |
* This program is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
* or FITNESS FOR A PARTICULAR PURPOSE. | |
* | |
*/ |
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
// Reverses a mapping of map: T -> vector<S> to map: S -> vector<T> | |
template<typename T, typename S> | |
void reverseMapping( map< T, vector<S> >& oMapping, map< S, vector<T> >& revMapping ) | |
{ | |
for( typename map< T, vector<S> >::iterator iter = oMapping.begin() ; iter != oMapping.end() ; ++iter ) | |
{ | |
for( int i = 0 ; i < iter->second.size() ; i++ ) | |
{ | |
pair< typename map< S, vector<T> >::iterator, bool > res = | |
revMapping.insert( make_pair( iter->second[i], vector<T>() ) ) ; |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>DVTConsoleDebuggerInputTextColor</key> | |
<string>0 0 0 1</string> | |
<key>DVTConsoleDebuggerInputTextFont</key> | |
<string>Menlo-Regular - 12.0</string> | |
<key>DVTConsoleDebuggerOutputTextColor</key> | |
<string>0 0 0 1</string> |
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 <stdlib.h> // MUST BE BEFORE GLUT ON WINDOWS | |
#ifdef _WIN32 | |
#include <gl/glut.h> | |
#else | |
#include <GLUT/glut.h> | |
#include <OpenGL/gl.h> | |
#include <OpenGL/glu.h> | |
#endif |
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
// Put this in a separate .h file (called "getopt.h"). | |
// The prototype for the header file is: | |
/* | |
#ifndef GETOPT_H | |
#define GETOPT_H | |
int getopt(int nargc, char * const nargv[], const char *ostr) ; | |
#endif | |
*/ |
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
From http://en.wikipedia.org/wiki/Box-drawing_character | |
┘ ┐ ┌ └ ┼ ─ ├ ┤ ┴ ┬ │ • × ⌘ π √ ÷ ² ³ ¼ ½ ¾ | |
A matrix: | |
┌ ┐ | |
│ 1 0 0 │ | |
│ 0 1 0 │ | |
│ 0 0 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
#ifndef CALLBACK_H | |
#define CALLBACK_H | |
#include <functional> | |
using namespace std ; | |
// REQUIRES APPLE LLVM | |
//Under Apple LLVM compiler 4.0 - Language, | |
// - C++ Standard Library: choose libc++ (LLVM C++ standard with C++11 support) | |
// NOT GNU |
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
bool SecCheck( OSStatus res, const char* msg ) | |
{ | |
if( res==errSecSuccess ) | |
{ | |
printf( "< %s okie dokie >\n", msg ) ; // COMMENT THIS OUT TO SILENCE OK's | |
} | |
else | |
{ | |
printf( "< NOT OK!! >: %s FAILED:\n >> ", msg ) ; | |
switch( res ) |
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
#ifndef KEYCHAIN_H | |
#define KEYCHAIN_H | |
/* | |
kSecAttrAccessible - A CFTypeRef (opaque) value that indicates when your app | |
needs access to the data in a keychain item. You should choose the | |
most restrictive option that meets your app’s needs so that iOS can protect | |
that item to the greatest extent possible. For a list of possible values, | |
see “Keychain Item Accessibility Constants.” |
OlderNewer