Tags
from .bash_history…
sudo yum install java-1.6.0-openjdk-devel
well…where did that install to? Check out the crazy stuff @ /usr/lib/jvm/
sudo JAVA_HOME=/usr/lib/jvm/java-openjdk
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
14 Monday Jul 2014
Posted Java, Linux / UNIX
in≈ Comments Off on More installing Java on CentOS
Tags
from .bash_history…
sudo yum install java-1.6.0-openjdk-devel
well…where did that install to? Check out the crazy stuff @ /usr/lib/jvm/
sudo JAVA_HOME=/usr/lib/jvm/java-openjdk
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
14 Monday Jul 2014
Posted Apache Tomcat, Application Servers, Linux / UNIX
in≈ Comments Off on IPTABLES to redirect 80 to 8080 for Tomcat
This is partially noted in some earlier posts, but the full detail is missing…
sudo /sbin/iptables -I INPUT 1 -p tcp –dport 8080 -j ACCEPT
sudo /sbin/iptables -I INPUT 1 -p tcp –dport 80 -j ACCEPT
sudo iptables -t nat -A PREROUTING -p tcp -m tcp –dport 80 -j REDIRECT –to-ports 8080
sudo service iptables save
sudo service iptables restart
14 Monday Jul 2014
Posted Linux / UNIX
in≈ Comments Off on Adding user to CentOS sudoers
edit /etc/sudoers and blunt trauma a user into it:
bob ALL=(ALL) ALL
Quick reference:
http://wiki.centos.org/TipsAndTricks/BecomingRoot
23 Wednesday Jan 2013
Posted Uncategorized
in≈ Comments Off on Identify full table scans in Oracle
Tags
I used to have a good query that I was happy with to do this, but I apparently lost it. Here’s some queries I’ve cobbled together today to identify full table scans and check their SQL…and determine that a maybe some new indexes might be in order based on real world queries…
select * from v$sql_plan where operation = ‘TABLE ACCESS’ and options = ‘FULL’
AND timestamp > sysdate – .01
order by TIME
and use the hash value to get the SQL:
select * from v$sql
where HASH_VALUE = {hash value of a result}
22 Tuesday Jan 2013
Posted C#, Code Samples
in≈ Comments Off on A cool row selection
Tags
A co-worker had something like this in a project, and I thought it was pretty neat. A lot cleaner than what I’ve been doing recently:
DataSet ds = GetDataFromSomeWhere(); IEnumerable<DataRow> rows = null; rows = from row in ds.Tables[0].AsEnumerable() where (row.Field<String>("ColumnA").ToUpper() == myValue || row.Field<String>("ColumnA").ToUpper() == "SomeOtherValue") && row.Field<String>("ColumnB").ToUpper() == aBoolean.ToString().ToUpper() && row.Field<String>("ColumnC").ToUpper() == "SomeDifferentValue" select row; foreach (DataRow row in rows) { // stuff }
18 Friday Jan 2013
Posted C#, Code Samples
in≈ Comments Off on C# ASP.Net find index of item in DropDownList by text
18 Friday Jan 2013
Posted C#, Code Samples
in≈ Comments Off on ASP.net update control in parent page from acsx user control
Needed to update a treeview control (oh noes!) on the page from an ascx user control. It was easier than I expected…
// path value for the tree node to update: string path = string.Format("0/{0}/{1}/{2}", this.Group, this.Trend, this.NID); // find the treeview control in the page controls collection: TreeView tvc = Page.FindControl("tvEvents") as TreeView; //magic! tvc.FindNode(path).ImageUrl = im;
11 Friday Jan 2013
Posted C#, Code Samples
in≈ Comments Off on Find Active Directory user by SMTP Email Address
Tags
We’re always having to look up users in AD by some value or another. The newest twist was to take an SMTP e-mail address and find the sAMAccountName (LAN login) for that user. We couldn’t just use the mail value because a lot of users may have more than one SMTP e-mail address…for nick-names and the like. So, it’s DirectorySearcher to the rescue! Code after the break uses an OR in the DirectorySearcher’s Filter property to look at PRIMARY SMTP addresses — proxyaddresses=SMTP:{0} OR OTHER SMTP addresses — proxyaddresses=smtp:{0} to find a match. Notice the case difference there?
02 Wednesday Jan 2013
Posted Uncategorized
in≈ Comments Off on Task Scheduler error “Action failed to start”
Tags
Interesting point in the Windows Server 2008 Task Scheduler that tripped me up (thanks to http://www.arcomit.co.uk/support/kb.aspx?kbid=000058 for pointing out the problem to me). Don’t include quotes in the Start In: value for your task, even if the path contains spaces. If there are spaces, the Program/Script: value must be surrounded by quotes, but the Start In: value has to be free of quotes…weird.
07 Friday Dec 2012
Posted Development Tools
in≈ Comments Off on Using Team Foundation Service
Let’s not beat around the bush. I love Microsoft’s Team Foundation Service. At the Alpha Job, we use SVN and I have Tortoise SVN installed to help me manage my interactions. We used TFS for one project, and I liked it so much more than the Tortoise Challenge. But, we were evicted from the TFS server due to cheap assedness. Needless to say, the 5 user freebie TFS-in-the-sky is perfect for my small projects.
What’s great:
What I’m getting used to:
What needs work:
I’ve paid for a couple of different SVN services, but like this offering from Microsoft (even free for a small team!) much better. I’m going to try out the Eclipse plug-in, and understand that I can even connect XCode’s GIT repository to it. Good stuff. Good stuff.