Skip to content

Instantly share code, notes, and snippets.

Kim, Seungho (isho) iolate

View GitHub Profile
@iolate
iolate / pam_auth.c
Created Mar 5, 2019
PAM Authentication for OpenVPN auth-user-pass-verify
View pam_auth.c
// gcc -o pam_auth pam_auth.c -lpam
#include <security/pam_appl.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int custom_converation(int num_msg, const struct pam_message** msg, struct pam_response** resp, void* appdata_ptr) {
// Provide password for the PAM conversation response that was passed into appdata_ptr
struct pam_response* reply = (struct pam_response* )malloc(sizeof(struct pam_response));
View sshwrapper.sh
#!/bin/bash
# shellinabox ssh wrapper
# -s /:nobody:nogroup:/:/path/to/sshwrapper.sh
echo ""
echo "Example: user@host[:22]"
read -p "Connect to: " connstr;
if ! [[ "$connstr" =~ "@" ]]; then
echo ""
@iolate
iolate / Soribada.js
Created Jan 6, 2017
BeardedSpice MediaStrategy for Soribada
View Soribada.js
//
// Soribada.js
// BeardedSpice
//
// Created by iolate <iolate@me.com> on 2016. 12. 28..
// Copyright © 2016 GPL v3 http://www.gnu.org/licenses/gpl.html
//
// http://www.soribada.com/
//
View LoginItem.m
-(void) addAppAsLoginItem {
if ([self wasAppAddedAsLoginItem]) return;
NSString * appPath = [[NSBundle mainBundle] bundlePath];
// This will retrieve the path for the application
// For example, /Applications/test.app
CFURLRef url = (__bridge CFURLRef)[NSURL fileURLWithPath:appPath];
// Create a reference to the shared file list.
@iolate
iolate / UIActivitiIndicatorOnUITableViewHeader.mm
Created Apr 29, 2013
UIActivityIndicator on UITableView header. ( >= iOS6 )
View UIActivitiIndicatorOnUITableViewHeader.mm
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
UITableViewHeaderFooterView *sectionHeaderView = nil;
if (section == 1) {
sectionHeaderView = [tableView dequeueReusableHeaderFooterViewWithIdentifier:@"headerIndicatorView"];
if (sectionHeaderView == nil) {
sectionHeaderView = [[UITableViewHeaderFooterView alloc] initWithReuseIdentifier:@"headerIndicatorView"];
}
float indicatorSize = 21.0f;
@iolate
iolate / AdditionalUIWindow.xm
Last active Dec 16, 2015
[THEOS] Additional UIWindows - Rotating UIWindow when orientation was changed.
View AdditionalUIWindow.xm
#define UPDATE_ORIENTATION_NOTI CFSTR("iolate/UpdateOrientation")
static UIWindow* additionalWindow = nil;
static UIView* mainViewInWindow = nil;
static void updateOrientation(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) {
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
int orientation_ = 0;
You can’t perform that action at this time.