venable dot devin at gmail dot com
view sourceyum install expat-devel zlib-devel uuid-c++-devel openssl-devel
wget http://www.carfab.com/apachesoftware/activemq/activemq-cpp/source/activemq-cpp-library-3.2.1-src.tar.gz wget http://mirror.candidhosting.com/pub/apache/apr/apr-1.4.2.tar.gz
[root@myserver] cd apr-1.4.2 [root@myserver] ./configure --prefix=/usr --libdir=/usr/lib CXXFLAGS="-m32" LDFLAGS="-m32" CFLAGS="-m32" --build=i686-redhat-linux-gnu PKG_CONFIG_PATH=/usr/lib/pkgconfig [root@myserver] ./make [root@myserver] ./make install
[root@myserver] cd ../activemq-cpp-library-3.2.1 [root@myserver] ./configure --prefix=/usr --libdir=/usr/lib CXXFLAGS="-m32" LDFLAGS="-m32" CFLAGS="-m32" --build=i686-redhat-linux-gnu PKG_CONFIG_PATH=/usr/lib/pkgconfig --with-apr=../apr-1.4.2/apr-1-config [root@myserver] ./make [root@myserver] ./make install
qemu-img convert windowsxp.img -O vdi windowsxp.vdi
dd if=/dev/zero of=vm8.img bs=2048k count=12000 kvm -m 512 -cdrom winxp.iso -boot d v8.img
from PIL import Image import sys, os def bw(pt): if pt>126: return 255 else: return 0 for infile in sys.argv[1:]: f, e = os.path.splitext(infile) outfile = f + "_mod" + e im = Image.open(infile) im = im.convert('L') out = im.point(bw) out.save(outfile) print outfile
from PIL import Image import sys, os for infile in sys.argv[1:]: im = Image.open(infile) data = im.getdata() for idx in range (0, len(data)): i = data[idx] if i == 255: print 'X', else: print ' ', if (idx+1) % 24 == 0: print ''
devin@studio:~/src/py$ python showdata.py /home/devin/Video/bitmaps/foo_00041_mod.bmp
X X X X X X X X X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X
X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X X X
X X X X X X X X X X X X
X X X X X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X X X X X X X X X
mplayer animated.gif -vo yuv4mpeg ffmpeg -i stream.yuv -an -r 24 -b 640 -s vga -aspect 4:3 test.avi
mencoder -oac copy -ovc copy -forceidx test.avi test2.avi -o test.avi mencoder -oac copy -ovc copy -forceidx test.avi test2.avi -o test.avi mencoder -oac copy -ovc copy -forceidx test.avi test2.avi -o test.avi
mplayer -loop 10 test.avi -vo yuv4mpeg
avimerge -i test.avi test2.avi test3.avi - o mergedfile.avi
libv4lconvert: Error decompressing JPEG: unknown huffman code: 0000ffd9 libv4lconvert: Error decompressing JPEG: unknown huffman code: 0000ffff libv4lconvert: Error decompressing JPEG: unknown huffman code: 0000ffec libv4lconvert: Error decompressing JPEG: unknown huffman code: 0000ffff libv4lconvert: Error decompressing JPEG: unknown huffman code: 0000ffd9 libv4lconvert: Error decompressing JPEG: unknown huffman code: 0000fffd
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
autocmd FileType make setlocal noexpandtab
.file "tiny.cpp" .local _ZStL8__ioinit .comm _ZStL8__ioinit,1,1 .section .rodata .LC0: .string "Hello World" .text .globl main .type main, @function main: .LFB957: .cfi_startproc .cfi_personality 0x0,__gxx_personality_v0 pushl %ebp .cfi_def_cfa_offset 8 movl %esp, %ebp .cfi_offset 5, -8 .cfi_def_cfa_register 5 andl $-16, %esp subl $16, %esp movl $.LC0, 4(%esp) movl $_ZSt4cout, (%esp) call _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc movl $_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_, 4(%esp) movl %eax, (%esp) call _ZNSolsEPFRSoS_E movl $0, %eax leave ret .cfi_endproc .LFE957: .size main, .-main .type _Z41__static_initialization_and_destruction_0ii, @function _Z41__static_initialization_and_destruction_0ii: .LFB966: .cfi_startproc .cfi_personality 0x0,__gxx_personality_v0 pushl %ebp .cfi_def_cfa_offset 8 movl %esp, %ebp .cfi_offset 5, -8 .cfi_def_cfa_register 5 subl $24, %esp cmpl $1, 8(%ebp) jne .L5 cmpl $65535, 12(%ebp) jne .L5 movl $_ZStL8__ioinit, (%esp) call _ZNSt8ios_base4InitC1Ev movl $_ZNSt8ios_base4InitD1Ev, %eax movl $__dso_handle, 8(%esp) movl $_ZStL8__ioinit, 4(%esp) movl %eax, (%esp) call __cxa_atexit .L5: leave ret .cfi_endproc .LFE966: .size _Z41__static_initialization_and_destruction_0ii, .-_Z41__static_initialization_and_destruction_0ii .type _GLOBAL__I_main, @function _GLOBAL__I_main: .LFB967: .cfi_startproc .cfi_personality 0x0,__gxx_personality_v0 pushl %ebp .cfi_def_cfa_offset 8 movl %esp, %ebp .cfi_offset 5, -8 .cfi_def_cfa_register 5 subl $24, %esp movl $65535, 4(%esp) movl $1, (%esp) call _Z41__static_initialization_and_destruction_0ii leave ret .cfi_endproc .LFE967: .size _GLOBAL__I_main, .-_GLOBAL__I_main .section .ctors,"aw",@progbits .align 4 .long _GLOBAL__I_main .weakref _ZL20__gthrw_pthread_oncePiPFvvE,pthread_once .weakref _ZL27__gthrw_pthread_getspecificj,pthread_getspecific .weakref _ZL27__gthrw_pthread_setspecificjPKv,pthread_setspecific .weakref _ZL22__gthrw_pthread_createPmPK14pthread_attr_tPFPvS3_ES3_,pthread_create .weakref _ZL20__gthrw_pthread_joinmPPv,pthread_join .weakref _ZL21__gthrw_pthread_equalmm,pthread_equal .weakref _ZL20__gthrw_pthread_selfv,pthread_self .weakref _ZL22__gthrw_pthread_detachm,pthread_detach .weakref _ZL22__gthrw_pthread_cancelm,pthread_cancel .weakref _ZL19__gthrw_sched_yieldv,sched_yield .weakref _ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t,pthread_mutex_lock .weakref _ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t,pthread_mutex_trylock .weakref _ZL31__gthrw_pthread_mutex_timedlockP15pthread_mutex_tPK8timespec,pthread_mutex_timedlock .weakref _ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t,pthread_mutex_unlock .weakref _ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t,pthread_mutex_init .weakref _ZL29__gthrw_pthread_mutex_destroyP15pthread_mutex_t,pthread_mutex_destroy .weakref _ZL30__gthrw_pthread_cond_broadcastP14pthread_cond_t,pthread_cond_broadcast .weakref _ZL27__gthrw_pthread_cond_signalP14pthread_cond_t,pthread_cond_signal .weakref _ZL25__gthrw_pthread_cond_waitP14pthread_cond_tP15pthread_mutex_t,pthread_cond_wait .weakref _ZL30__gthrw_pthread_cond_timedwaitP14pthread_cond_tP15pthread_mutex_tPK8timespec,pthread_cond_timedwait .weakref _ZL28__gthrw_pthread_cond_destroyP14pthread_cond_t,pthread_cond_destroy .weakref _ZL26__gthrw_pthread_key_createPjPFvPvE,pthread_key_create .weakref _ZL26__gthrw_pthread_key_deletej,pthread_key_delete .weakref _ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t,pthread_mutexattr_init .weakref _ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti,pthread_mutexattr_settype .weakref _ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t,pthread_mutexattr_destroy .ident "GCC: (Ubuntu 4.4.3-4ubuntu5) 4.4.3" .section .note.GNU-stack,"",@progbits
Apr 28 12:51:35 theserver sshd[16285]: Authentication refused: bad ownership or modes for directory /home/theuser
drwxrwx--- 36 theuser thegroup 4096 Apr 28 11:56 ..
#!/bin/sh # # Change Primary Monitor for Gnome # ver 1.0 # # Copyright (c) 2010 michal@post.pl # # This file is free software. You can redistribute it # and/or modify it under the terms of the GNU # General Public License (GPL) as published by # the Free Software Foundation, in version 3. # It works for me. I hope it works for you as well. # NO WARRANTY of any kind. # # get list of top-level gnome panels getTopPanels() { gconftool-2 --all-dirs /apps/panel/toplevels } # get monitor number for this panel getMonitor() { local PANEL=$1 gconftool-2 --get $PANEL/monitor } # set monitor to display on for given top-level panel setMonitor() { local PANEL=$1 local NEW=$2 gconftool-2 --set --type int $PANEL/monitor $NEW } # return number of connected monitors getConnectedMonitors() { xrandr --query | grep -c '^.* connected' } # compute next monitor nextMonitor() { # number of monitors local CURRENT=$1 local MONITORS=$2 awk 'BEGIN{ print ('$CURRENT' + 1) % '$MONITORS'; }' } # logging finction log() { echo $@ 1>&2 } # main logic below ############# MONITORS=`getConnectedMonitors` log "Detected $MONITORS connected monitors" getTopPanels | while read PANEL do MONITOR=`getMonitor $PANEL` NEW=`nextMonitor $MONITOR $MONITORS` log "Panel $PANEL is displayed on $MONITOR. Switching to monitor $NEW." setMonitor $PANEL $NEW done
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
yum install mod_security
ModSecurity: Unable to retrieve collection (name "", key ""). Use SecDataDir to define data directory first.
vim /etc/httpd/modsecurity.d/modsecurity_crs_10_config.conf ( Added SecDataDir /usr/local/apache/modsec_data ) mkdir /usr/local/apache mkdir /usr/local/apache/modsec_data chown apache:apache /usr/local/apache/modsec_data chown apache:apache /usr/local/apache
SecDefaultAction "phase:2,pass"
SecDefaultAction "phase:2,deny,log,status:403"
You are in the middle of a conflicted merge.
git mergetool
fatal: You have not concluded your merge. (MERGE_HEAD exists)
The following is an easy mistake to make for users coming from version control systems with an "update and commit"-style workflow. 1. git merge 2. resolve conflicts 3. git pull, instead of commit
# udevinfo -a -p $(udevinfo -q path -n /dev/sdb)
SYSFS{rev}=="ST6O"
SYSFS{model}=="Hitachi HDT72101"
ACTION=="add",SYSFS{rev}=="ST6O",SYSFS{model}=="Hitachi HDT72101",KERNEL=="sd?1",NAME="REMOVABLE", RUN+="/bin/mount /dev/REMOVABLE /media/removable" ACTION=="remove",SYSFS{rev}=="ST6O",SYSFS{model}=="Hitachi HDT72101",RUN+="/bin/umount /media/removable"
Python 2.4.3 (#1, Jul 27 2009, 17:56:30) [GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from datetime import datetime >>> d = datetime.strptime("21-JAN-08", "%d-%b-%y") Traceback (most recent call last): File "", line 1, in ? AttributeError: type object 'datetime.datetime' has no attribute 'strptime'
>>> import time >>> time.strptime("21-JAN-08", "%d-%b-%y") (2008, 1, 21, 0, 0, 0, 0, 21, -1)
>>> t = time.strptime("21-JAN-08", "%d-%b-%y") >>> datetime(*t[0:6]) >>> datetime.datetime(2008, 1, 21, 0, 0)
egrep 'http|mono' /var/log/audit/audit.log | audit2allow -M myhttp
module myhttp 1.0; require { type httpd_tmp_t; type device_t; type initrc_t; type httpd_t; type httpd_sys_script_t; type http_port_t; type port_t; type inotifyfs_t; class process { execstack execmem getsched ptrace }; class unix_stream_socket connectto; class chr_file { read write ioctl }; class tcp_socket name_connect; class file execute; class sem { unix_read write unix_write associate read destroy }; class shm { unix_read read write unix_write associate }; class dir read; } #============= httpd_sys_script_t ============== allow httpd_sys_script_t http_port_t:tcp_socket name_connect; allow httpd_sys_script_t httpd_tmp_t:file execute; allow httpd_sys_script_t inotifyfs_t:dir read; allow httpd_sys_script_t self:process { execmem getsched ptrace }; allow httpd_sys_script_t self:sem { unix_read write unix_write associate read destroy }; #============= httpd_t ============== allow httpd_t device_t:chr_file { read write ioctl }; allow httpd_t httpd_sys_script_t:unix_stream_socket connectto; allow httpd_t initrc_t:shm { unix_read read write unix_write associate }; allow httpd_t port_t:tcp_socket name_connect; allow httpd_t self:process { execstack execmem };
apt-get install libapache2-mod-mono mono-apache-server2
<%@ WebService Language="c#" Codebehind="TestService.asmx.cs" Class="WebServiceTests.TestService" %> using System; using System.Web.Services; using System.Web.Services.Protocols; namespace WebServiceTests { public class TestService : System.Web.Services.WebService { [WebMethod] public string Echo (string a) { return a; } [WebMethod] public int Add (int a, int b) { return a + b; } } }
yum install mod_mono xsp mono-web
AddType application/x-asp-net .aspx
AddType application/x-asp-net .asmx
AddType application/x-asp-net .ashx
AddType application/x-asp-net .asax
AddType application/x-asp-net .ascx
AddType application/x-asp-net .soap
AddType application/x-asp-net .rem
AddType application/x-asp-net .axd
AddType application/x-asp-net .cs
AddType application/x-asp-net .config
AddType application/x-asp-net .Config
AddType application/x-asp-net .dll
AddType application/x-asp-net .asp
DirectoryIndex index.aspx
DirectoryIndex Default.aspx
DirectoryIndex default.aspx
Alias /demo /usr/lib64/xsp/test
MonoApplications "/demo:/usr/lib64/xsp/test"
MonoServerPath /usr/bin/mod-mono-server
chcon -t httpd_sys_content_t '/usr/bin/mono'
module mymono 1.0; require { type lib_t; type tmp_t; type mono_exec_t; type httpd_t; type httpd_sys_script_t; class process ptrace; class sock_file { write create }; class sem create; class file { read execute_no_trans }; } #============= httpd_sys_script_t ============== allow httpd_sys_script_t self:sem create; #============= httpd_t ============== allow httpd_t lib_t:file execute_no_trans; allow httpd_t mono_exec_t:file { read execute_no_trans }; allow httpd_t self:process ptrace; allow httpd_t tmp_t:sock_file { write create };
Feb 8 08:43:32 carbon setroubleshoot: SELinux is preventing the mono from using potentially mislabeled files (mod_mono_server_global). For complete SELinux messages. run sealert -l a00a5946-cec1-4291-a410-e74c5f96edfd
restorecon -R -v /tmp/.wapi
module mynotify 1.0; require { type httpd_t; type inotifyfs_t; class dir read; } #============= httpd_t ============== allow httpd_t inotifyfs_t:dir read;
restorecon -R -v /tmp/.wapi
chcon -t httpd_sys_content_t '/usr/bin/mono'
H0 = 0 stages 1 to n: Hj = Enc(K, Dj XOR H{j-1}) MAC = Enc(K, Dec(K', Hn))
set m0 72C29C2371CC9BDB #message set m1 65B779B8E8D37B29 set m2 ECC154AA56A8799F set m3 AE2F498F76ED92F2 set pd 8000000000000000 #padding set iv 0000000000000000 #initialisation vector set k0 7962D9ECE03D1ACD #key set k1 4C76089DCE131543 set xx {iv} # setup for mj in {m0} {m1} {m2} {m3} {pd} # for each block including padding set xx `xor {xx} {mj}` # chain set xx `des -k {k0} -c {xx}` #encrypt end set xx `des -k {k1} -d {xx}` #decrypt set xx `des -k {k0} -c {xx}` #encrypt echo {xx} #show result 5F1448EEA8AD90A7
#include openssl/des.h #include memory #include string.h //message + padding const unsigned char msg[40] = { 0x72, 0xC2, 0x9C, 0x23, 0x71, 0xCC, 0x9B, 0xDB, 0x65, 0xB7, 0x79, 0xB8, 0xE8, 0xD3, 0x7B, 0x29, 0xEC, 0xC1, 0x54, 0xAA, 0x56, 0xA8, 0x79, 0x9F, 0xAE, 0x2F, 0x49, 0x8F, 0x76, 0xED, 0x92, 0xF2, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; //initialization vector unsigned char iv[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; unsigned char k0[8] = { 0x79, 0x62, 0xD9, 0xEC, 0xE0, 0x3D, 0x1A, 0xCD }; unsigned char k1[8] = { 0x4C, 0x76, 0x08, 0x9D, 0xCE, 0x13, 0x15, 0x43 }; void print_hex(const unsigned char *bs, int n) { for (int i = 0; i < n; i++) printf("%02x", bs[i]); printf("\n"); } void des_ecb_crypt(unsigned char* input, unsigned char* output, int encrypt, unsigned char* key) { des_key_schedule sched; des_set_key((des_cblock *) key, sched); DES_ecb_encrypt((const_DES_cblock *)input, (const_DES_cblock *)output, &sched;, encrypt); } void xor_block(unsigned char* src, unsigned char* dest) { for (int x = 0; x < 8; x++) { src[x] = src[x] ^ dest[x]; } } int main(int argc, char* argv[]) { unsigned char output[8]; unsigned char xx[8]; unsigned char block[8]; int offset = 0; memcpy(xx, iv, 8); // Chain and encrypt 5 8-bit blocks for (int x = 0; x < 5; x++) { memcpy(block, &msg;[offset] , 8); offset+=8; //set xx `xor {xx} {mj}` # chain xor_block(xx, block); //set xx `des -k {k0} -c {xx}` #encrypt des_ecb_crypt(xx, output, DES_ENCRYPT, k0); memcpy(xx, output, 8); } des_ecb_crypt(xx, output, DES_DECRYPT, k1); memcpy(xx, output, 8); des_ecb_crypt(xx, output, DES_ENCRYPT, k0); memcpy(xx, output, 8); print_hex(xx, 8); return 1; }
:set list
:set nolist
:%!xxd
<Directory "/var/www/html/python"> AddHandler mod_python .py PythonHandler mptest PythonDebug On </Directory> <Location "/"> SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE hsm.settings PythonDebug On PythonPath "['/home/stuff/src/python', '/home/stuff/src/python/hsm'] + sys.path" </Location>
WSGIScriptAlias / /usr/local/www/wsgi-scripts/hsm.wsgi <Directory /usr/local/www/wsgi-scripts> Order allow,deny Allow from all </Directory>
import os import sys os.environ['DJANGO_SETTINGS_MODULE'] = 'hsm.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() sys.stdout = sys.stderr
[Tue Jan 05 11:02:08 2010] [error] [client 10.8.8.62] return query.execute_sql(return_id) [Tue Jan 05 11:02:08 2010] [error] [client 10.8.8.62] File "/usr/lib/python2.4/site-packages/django/db/models/sql/subqueries.py", line 320, in execute_sql [Tue Jan 05 11:02:08 2010] [error] [client 10.8.8.62] cursor = super(InsertQuery, self).execute_sql(None) [Tue Jan 05 11:02:08 2010] [error] [client 10.8.8.62] File "/usr/lib/python2.4/site-packages/django/db/models/sql/query.py", line 2369, in execute_sql [Tue Jan 05 11:02:08 2010] [error] [client 10.8.8.62] cursor.execute(sql, params) [Tue Jan 05 11:02:08 2010] [error] [client 10.8.8.62] File "/usr/lib/python2.4/site-packages/django/db/backends/util.py", line 19, in execute [Tue Jan 05 11:02:08 2010] [error] [client 10.8.8.62] return self.cursor.execute(sql, params) [Tue Jan 05 11:02:08 2010] [error] [client 10.8.8.62] File "/usr/lib/python2.4/site-packages/django/db/backends/sqlite3/base.py", line 193, in execute [Tue Jan 05 11:02:08 2010] [error] [client 10.8.8.62] return Database.Cursor.execute(self, query, params) [Tue Jan 05 11:02:08 2010] [error] [client 10.8.8.62] OperationalError: attempt to write a readonly database
Summary: SELinux is preventing the httpd from using potentially mislabeled files ./sqlite3.db (usr_t). Detailed Description: SELinux has denied the httpd access to potentially mislabeled files ./sqlite3.db. This means that SELinux will not allow httpd to use these files. Many third party apps install html files in directories that SELinux policy cannot predict. These directories have to be labeled with a file context which httpd can access. Allowing Access: If you want to change the file context of ./sqlite3.db so that the httpd daemon can access it, you need to execute it using chcon -t httpd_sys_content_t './sqlite3.db'. You can look at the httpd_selinux man page for additional information.
sudo chcon -R system_u:object_r:httpd_sys_content_t database_folder
apt-get install fluid libmxml-dev libfftw3-3 mffm-fftw-dev libasound2-dev