Skip to content

Instantly share code, notes, and snippets.

View adamramadhan's full-sized avatar
Sparkles

Adam Ramadhan adamramadhan

Sparkles
View GitHub Profile
@adamramadhan
adamramadhan / README.md
Created February 3, 2024 15:29 — forked from gjreasoner/README.md
Expand Ubuntu 20 Proxmox Disk
# Resize the file system in UI, under VM -> Hardware -> Click on the disk to resize, click "Resize disk" button

# Confirm increase in disk space (1TB in my case)
$ lsblk
NAME                      MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                         8:0    0    1T  0 disk
├─sda1                      8:1    0    1M  0 part
├─sda2                      8:2    0    1G  0 part /boot
└─sda3                      8:3    0    1T  0 part

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@adamramadhan
adamramadhan / save_attach.js
Created June 18, 2012 19:29 — forked from baudehlo/save_attach.js
Haraka Plugin to save attachments to disk
var fs = require('fs');
// Bind to receiving of data
exports.hook_data = function( next, connection, params ) {
var haraka = this,
uid = connection.transaction.uuid;
connection.transaction.notes.attachments = {};

NOTE: This documentation has been put here because I couldn't find it anywhere else. I am not associated with Crunchbase in any way. I cannot help you with your Crunchbase API problems. If you need help try here: https://groups.google.com/forum/#!forum/crunchbase-api

CrunchBase API v1 Documentation

Overview

The CrunchBase API provides JSON representations of the data found on CrunchBase. The API currently supports three actions: "show", "search", and "list", which are each described below.

<?php
/**
* Looks for unquoted keys in a json string and fixes them ie: {a:"b"} => {"a":"b"}
* @param string $string A json string that is suspect
* @return string A valid json string
*/
function fix_json($string){
// (no qupte) (word) (no quote) (semicolon)
$regex = '/(?<!")([a-zA-Z0-9_]+)(?!")(?=:)/i';

Proper Python in Windows

Prerequisites:

  • Python2.7 (x86) from Python.org
  • Microsoft Visual Studio

Step 1: Install Distribute & Pip

<?php
preg_match("/(?P<foo>abc)(.*)(?P<bar>xyz)/",
'abcdefghijklmnopqrstuvwxyz',
$matches);
print_r($matches);
?>
$data['username'] = $username;
$datauser['username'] = $username;
$data['password'] = $password;
$data['companyName'] = $companyName;
$data['OwnerFn'] = $OwnerFn;
$data['OwnerLn'] = $OwnerLn;
$data['companyPhone'] = $companyPhone;
$data['partnership'] = $partnership;
if($db->AutoExecute('company', $data, 'INSERT'))
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';
CREATE SCHEMA IF NOT EXISTS `mydb` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci ;
CREATE SCHEMA IF NOT EXISTS `bproject` ;
-- -----------------------------------------------------
-- Table `bproject`.`users`
-- -----------------------------------------------------