This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#http://stackoverflow.com/questions/50159/show-all-libraries-used-by-executables-on-linux | |
find /bin -type f -perm /a+x -exec ldd {} \; \ | |
| grep so \ | |
| sed -e '/^[^\t]/ d' \ | |
| sed -e 's/\t//' \ | |
| sed -e 's/.*=..//' \ | |
| sed -e 's/ (0.*)//' \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.airhacks</groupId> | |
<artifactId>javaee7-essentials-pom</artifactId> | |
<version>7.0</version> | |
<packaging>war</packaging> | |
<dependencies> | |
<dependency> | |
<groupId>javax</groupId> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<#assign liferay_ui = taglibLiferayHash["/WEB-INF/tld/liferay-ui.tld"] /> | |
<table> | |
<thead> | |
<tr> | |
<th> | |
Name | |
</th> | |
<th> | |
Value | |
</th> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET FOREIGN_KEY_CHECKS = 0; | |
SET GROUP_CONCAT_MAX_LEN=32768; | |
SET @tables = NULL; | |
SELECT GROUP_CONCAT(table_name) INTO @tables | |
FROM information_schema.tables | |
WHERE table_schema = (SELECT DATABASE()); | |
SELECT IFNULL(@tables,'dummy') INTO @tables; | |
SET @tables = CONCAT('DROP TABLE IF EXISTS ', @tables); | |
PREPARE stmt FROM @tables; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET FOREIGN_KEY_CHECKS = 0; | |
SET GROUP_CONCAT_MAX_LEN=32768; | |
SET @tables = NULL; | |
SELECT GROUP_CONCAT(table_name) INTO @tables | |
FROM information_schema.columns | |
WHERE table_schema = (SELECT DATABASE()) AND (LOWER(table_name) like 'x%' OR LOWER(table_name) like 'sm%' OR LOWER(table_name) like 'invites%' OR LOWER(table_name) like 'blockvendor%' ) AND column_name = 'id_'; | |
select REPLACE(@tables, ',', ' change id_ id int(11) ; alter table ') into @tables; | |
select CONCAT('alter table ', @tables) into @tables; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
diff --old-line-format='%L' --new-line-format='%L' $1 $2 > $2 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Not you can do XMLLINT_INDENT="(Ctrl+V, Ctrl+I)" to change indent to tab | |
xmllint -o $1 --format $1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.liferay.portal.model.*; | |
import com.liferay.portal.service.*; | |
import com.liferay.counter.service.*; | |
import com.liferay.portal.util.*; | |
import java.util.*; | |
/*********** MODIFY THESE VARIABLES **********/ | |
templateName = "User Profile Site Template"; // name of a site template | |
/*********** DEBUG VARIABLES *****************/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.liferay.portal.model.*; | |
import com.liferay.portal.service.*; | |
import com.liferay.counter.service.*; | |
import com.liferay.portal.util.*; | |
import java.util.*; | |
import org.apache.commons.lang.exception.*; | |
/*********** DEBUG VARIABLES *****************/ | |
dbg = ""; | |
C = "\n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
import java.io.*; | |
Process proc = new ProcessBuilder("/bin/bash", "-c", | |
"ifconfig; env | sort; ps -ef | grep -i java").start(); | |
Reader reader = new InputStreamReader(proc.getInputStream()); | |
int ch; | |
String output = ""; | |
while ((ch = reader.read()) != -1) |