Compiling Apache 2.2.29

#See https://adrhc.go.ro/wordpress/common-commands-when-building/ for building environment, x.sh script and other things not defined here. #Before starting you must declare the environment variables specified at the link above. #building env vars (required when rebuilding too) APACHE_MPM=worker NEW_BUILD_NAME=apache NEW_BUILD_VER=2.2.29-$APACHE_MPM NEW_BUILD_NAME_AND_VER=$NEW_BUILD_NAME-$NEW_BUILD_VER ls -l /tmp/$NEW_BUILD_NAME-* […]

Compiling litmus 0.13

cd ~/compile rm -r litmus-0.13 tar -xzf litmus-0.13.tar.gz cd ~/compile/litmus-0.13 export LDFLAGS=”-L/ffp/lib -lintl” export CPPFLAGS=”-I/ffp/include -I/ffp/include/readline” export CXXFLAGS=”-I/ffp/include -I/ffp/include/readline” export CFLAGS=”-march=armv5te -mtune=xscale -mfloat-abi=soft -mabi=aapcs-linux -O2 -lintl -Wall” export LC_ALL=POSIX ./configure –help > configure.help.txt ./configure –prefix=/ffp –disable-debug –enable-threadsafe-ssl=posix –with-ssl=openssl –with-included-neon nohup […]

Compiling php 5.5.x

cd ~/compile curl -L -k http://de1.php.net/get/php-5.5.19.tar.gz/from/this/mirror -o php-5.5.19.tar.gz tar -xzf php-5.5.19.tar.gz cd ~/compile/php-5.5.19 find . -type f \( -exec sed -i s/”\/usr\/bin\/perl”/”\/ffp\/bin\/perl”/ {} \; , -exec sed -i s/”\/usr\/bin\/python”/”\/ffp\/bin\/python”/ {} \; , -exec sed -i s/”\/usr\/bin\/bash”/”\/ffp\/bin\/bash”/ {} \; , -exec […]

Apache basic authentication password creation

# see http://passwordsgenerator.net/ # -c option means to create the passwords file /ffp/opt/apache-2.2.9-prefork/bin/htpasswd -c -m passwords_file_path user_name1 # -m option means to add/modify the user user_name2 /ffp/opt/apache-2.2.9-prefork/bin/htpasswd -m passwords_file_path user_name2 # -D option means to delete the user user_name3 htpasswd […]

Install linux headers

cd ~/compile rm -r linux-2.6.31.8 rm -r linux_headers mkdir linux_headers wget https://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.31.8.tar.gz tar xvzf linux-2.6.31.8.tar.gz cd linux-2.6.31.8 export ARCH=arm export ARM_ARCH=armv5te export CLFS_FLOAT=soft unset CFLAGS unset CPPFLAGS unset CXXFLAGS #For Zyxel NSA310 only: #Replace /ffp/home/root/compile/linux-2.6.31.8/arch/arm/Makefile with #/ffp/home/root/temp/build_NSA310/trunk/linux-2.6.31.8/arch/arm/Makefile #from http://gpl.nas-central.org/ZYXEL/NSA310_GPL/FW4.40/build_NSA310.tar.gz cp […]

Hibernate 4.3.5 + Spring 4.0.5

<bean id=”sessionFactory” lazy-init=”true” class=”org.springframework.orm.hibernate4.LocalSessionFactoryBean”> <property name=”dataSource” ref=”dataSource”/> <!–<property name=”mappingLocations”>–> <!–<list>–> <!–<value>classpath:/hibernate/**/*.hbm.xml</value>–> <!–</list>–> <!–</property>–> <property name=”packagesToScan” value=”image.exifweb.persistence”/> <property name=”hibernateProperties”> <props> <prop key=”hibernate.dialect”>org.hibernate.dialect.MySQL5InnoDBDialect</prop> <prop key=”hibernate.jdbc.batch_size”>20</prop> <prop key=”hibernate.show_sql”>false</prop> <prop key=”hibernate.format_sql”>true</prop> <prop key=”hibernate.validator.autoregister_listeners”>false</prop> <!–<prop key=”hibernate.hbm2ddl.auto”>update</prop>–> <!– <prop key=”hibernate.id.new_generator_mappings”>true</prop> <prop key=”hibernate.current_session_context_class”>jta</prop> –> <!–<prop key=”javax.persistence.validation.mode”></prop>–> </props> […]

Recursively remove all empty or almost empty directories

find /i-data/md0/video/ -type d -empty -delete # print files/directories with size less 1M: cd /********/Videos/couchpotato-complete du -sh * | grep -P “\d+K” | awk ‘{for (i=2; i<NF; i++) printf $i ” “; print $NF}’ | sort du -sh * | […]

ActiveMQ + Spring 3.2.x

<!– CachingConnectionFactory Definition, sessionCacheSize property is the number of sessions to cache –> <bean id=”connectionFactory” class=”org.springframework.jms.connection.CachingConnectionFactory”> <constructor-arg ref=”amqConnectionFactory”/> <property name=”exceptionListener” ref=”jmsExceptionListener”/> <property name=”sessionCacheSize” value=”100″/> <property name=”cacheConsumers” value=”true”/> </bean> <!– JmsTemplate Definition –> <bean id=”jmsTemplate” class=”org.springframework.jms.core.JmsTemplate”> <constructor-arg ref=”connectionFactory”/> </bean> <amq:connectionFactory id=”amqConnectionFactory” […]

JPA (hibernate 4.3.x) + Spring 3.2.x

<bean id=”transactionManager” class=”org.springframework.orm.jpa.JpaTransactionManager”> <property name=”entityManagerFactory” ref=”entityManager” /> </bean> <bean id=”entityManager” depends-on=”dataSource” class=”org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean”> <property name=”dataSource” ref=”dataSource” /> <property name=”packagesToScan” value=”…packages…persistence.entity” /> <property name=”persistenceUnitName” value=”gigi” /> <property name=”persistenceProvider”> <bean class=”org.hibernate.jpa.HibernatePersistenceProvider” /> </property> <property name=”jpaPropertyMap” ref=”jpaPropertyMap” /> <property name=”jpaVendorAdapter” ref=”jpaVendorAdapter” /> <property name=”jpaDialect”> […]

Tomcat

Pt debug din mediul de dezvoltare trebuie modificat: a) setenv.bat: SET “JAVA_HOME=c:\Program Files\Java\jdk1.7.0_60” CATALINA_OPTS=-Xms512m -Xmx2048m -XX:MaxPermSize=512M -XX:+CMSClassUnloadingEnabled -javaagent:c:\maven.repository.3x\org\springframework\spring-instrument-tomcat\4.0.6.RELEASE\spring-instrument-tomcat-4.0.6.RELEASE.jar SET “JPDA_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005” b) startup.bat (la finalul fisierului): call “%EXECUTABLE%” jpda start %CMD_LINE_ARGS% -> pt a determina utilizarea lui JPDA_OPTS

Install & configure ghost

Installing ghost on linux (official) Compiling nodejs cd /ffp/opt/ rm -r ghost #rm ghost.zip #curl -L -k https://ghost.org/zip/ghost-latest.zip -o ghost.zip unzip -uo ghost.zip -d ghost cd /ffp/opt/ghost find . -type f -exec sed -i s/”\/usr\/bin\/bash”/”\/ffp\/bin\/bash”/ {} \; find . -type […]

How to configure Stunnel

https://www.stunnel.org/howto.html https://www.stunnel.org/static/stunnel.html http://serverfault.com/questions/9708/what-is-a-pem-file-and-how-does-it-differ-from-other-openssl-generated-key-file https://support.ssl.com/index.php?/Knowledgebase/Article/View/19 stunnel /ffp/etc/stunnel/stunnel.conf cat /ffp/var/lib/stunnel/stunnel.pid cat /ffp/var/lib/stunnel/stunnel.log #Generate cert file necesar a fi specificat in stunnel.conf (varianta cu windows – preferata): openssl.exe req -newkey rsa:2048 -x509 -days 3660 -out stunnel-pub.pem -keyout stunnel-key.pem openssl.exe rsa -in stunnel-key.pem -out […]

How to create a certificate

# see https://www.openssl.org/docs/manmaster/apps/req.html # Create a certificate del adr-*.pem openssl req -newkey rsa:2048 -x509 -days 3660 -out adr-pub.pem -keyout adr-key.pem #bug: openssl req -newkey rsa:2048 -x509 -days 3660 -out adr-bitvise-pub.pem -keyout adr-bitvise-key.pem #bug: openssl req -new -x509 -days 3660 -out […]