Skip to content

Instantly share code, notes, and snippets.

View theclanks's full-sized avatar

Luis Carlos Otte Junior theclanks

View GitHub Profile
@theclanks
theclanks / seamake.sh
Last active June 6, 2017 06:50
seafile client build
#!/usr/bin/env bash
yum install vala vala-compat wget gcc libevent-devel openssl-devel gtk2-devel libuuid-devel sqlite-devel jansson-devel intltool cmake qt-devel fuse-devel
echo "Building and installing seafile client"
export version=4.2.8 # change this to your preferred version
alias wget='wget --content-disposition -nc'
wget https://github.com/haiwen/libsearpc/archive/v3.0.2.tar.gz
wget https://github.com/haiwen/ccnet/archive/v${version}.tar.gz
@theclanks
theclanks / build.sh
Last active August 29, 2015 14:06 — forked from NicolasT/build.sh
#!/bin/bash -ue
# Dependencies (list might be incomplete):
# src/libevent-2.0.21-stable.tar.gz
# src/libsearpc (I used git f022c6509cff2eb604024c003eb60bcda975c0b1)
# src/ccnet (with Nicolas' patches, I used 3495a78466add16cfa9eddfb35a312bb9ce55264)
# src/seafile (with Nicolas' patches, I used 59eb918655dfa5f1328ec72be00681c6192f523d)
#
# Toolchain:
# vala (vala-0.18.1-1.fc18.x86_64)
To set APM level:
camcontrol cmd ada0 -a "EF 05 00 00 00 00 00 00 00 00 xx 00"
To disable it:
camcontrol cmd ada0 -a "EF 85 00 00 00 00 00 00 00 00 00 00
To set AAM level:
camcontrol cmd ada0 -a "EF 42 00 00 00 00 00 00 00 00 xx 00"
To disable it:
camcontrol cmd ada0 -a "EF C2 00 00 00 00 00 00 00 00 00 00
public function echo_memory_usage() {
$mem_usage = memory_get_usage(true);
if ($mem_usage < 1024)
echo $mem_usage." bytes";
elseif ($mem_usage < 1048576)
echo round($mem_usage/1024,2)." kb";
else
echo round($mem_usage/1048576,2)." mb";
echo "".PHP_EOL;
}
@theclanks
theclanks / .cshrc
Last active December 13, 2015 11:03
FreeBSD Cshrc
# $FreeBSD: release/10.0.0/share/skel/dot.cshrc 243893 2012-12-05 13:56:39Z eadler $
#
# .cshrc - csh resource script, read at beginning of execution by each shell
#
# see also csh(1), environ(7).
# more examples available at /usr/share/examples/csh/
#
alias h history 25
alias j jobs -l
alias la ls -aF
Match User gnub
ChrootDirectory %h
PasswordAuthentication yes
ForceCommand internal-sftp
PermitTTY no
X11Forwarding no
AllowTcpForwarding no
AllowAgentForwarding no
@theclanks
theclanks / desk_stream.conf
Created December 10, 2013 14:10
Desktop Stream
Port 8090
BindAddress 0.0.0.0
MaxHTTPConnections 100
MaxClients 100
MaxBandwidth 1500
CustomLog -
NoDaemon
<Feed feed1.ffm>
File /tmp/feed1.ffm
@theclanks
theclanks / criptografia.php
Created October 10, 2013 21:15
Criptografia para PHP 5.3
<?
function encrypt($string, $key) {
$encryptionMethod = "AES-256-CBC";
$ivkey = sha1($key);
$iv = substr($ivkey, 0, 16);
return base64_encode(openssl_encrypt($string, $encryptionMethod, $key, 0, $iv));
}
--[[
$Id$
Copyright © 2007-2012 the VideoLAN team
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
@theclanks
theclanks / realloc_string.c
Created February 8, 2013 03:16
exemplo simples realloc
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
int main(){
char *buffer = NULL;
char palavra;
printf("Alocando memoria\n");