Skip navigation

I’ve officially migrated this wordpress blog to it’s own domain.

http://lotekness.net

That is all.

thumbs-up-haruhi

As is the case with everything it starts with God.

I’m speaking to believers here of course, but take the time to really reflect on God and who he is.  Infinite, immutable, omnipotent, righteous, perfect in every way.

Really get in there, think about this.  Sovereign, in control of everything.  Knowing the end from the beginning, working all things to his glory and to the good of those who love him.  The only thing in existence worthy of praise, because through him all things are made.

Now, stop and look at yourself.

Whoring ourselves out to anything that can offer you a quick fix to your immediate pleasure.  Even in our most righteous state, we are still unimaginably self centered and dirty.

Really get in there, into the darkest recesses of your mind where no one but you can hear the most intimate desires of your heart.  Really focus on that for a second, is that desire for God?  Is that desire wholesome?  Is that desire a desire you honestly believe God looks favorably upon?  Sin, is in the heart, not the act.  By sheer desire for a thing, apart from God, we have committed idolatry.  Like disobedient children, we choose our own way, completely defiant and ignorant to the right punishment we deserve.

The wages of sin is death.  There is no other way to look at that.  Now hold that thought for a moment.

Perfect God, compared to fallen man.

Focus on this now for a moment.

We deserve nothing, nothing but wrath.

Really stop and be honest with yourself, innocence vs. guilt.  The guilty should die no?

Yes, by all rights we should die.  Yet, instead of wrath, instead of death, instead of destruction, we receive mercy?

Not only mercy, but we receive God himself, as a living sacrifice to atone for our sins.  To not only die for us, but to live the life we couldn’t possibly live.  One of perfection, of righteousness, then obediently take death on a cross, and separation from the perfect communion with the God head.

We not only received this INCREDIBLE salvation, but we also received a place alongside God as co-heirs to the throne.

We are not worthy.

We will never be worthy.

We owe our everything to God, for his mercy, for his steadfast love, for his promise, for his good nature, for himself.

So how do you love your neighbor?  The same way it began with God, and ends with God.  You love them the way God loves you.

Unendingly, sacrificially, mercifully.


On a more regular basis I’d like to keep a stream of technical write ups, gaming news, theological thoughts, and or general “what’s going ons” with me and my family.  However with a work trip to Houston last week and general slap busy nature of my work since returning home; I’ve not had any time to collect some thoughts and formulate them into a blog post.  I want to hit some high points, and perhaps elaborate on them more in future posts.

High point #1 Samba DC

Ok, so people who have known me for any extended amount of time (from the age of 16 to 30) knows that I’m a Linux fan.  My work and lively hood mind you thrive around a Microsoft world, but I will never sell Linux short, nor fail to marvel at the amazing things that a thriving community of passionate individuals can create.  I also maintain a Linux server out of my home to manage DNS, DHCP, VOIP (TeamSpeak) and File sharing (NFS, iSCSI, and SMB).  I will also, on occasion, bring up outward facing game servers.  Just recently I decided to convert that server into a SAMBA DC for my, primarily, Windows 7 environment at home.

I run CentOS as my server distribution, which is a downstream of RHEL.  I’m running Samba version 3.5.4, at the time of this writing 3.6 is the latest stable release but didn’t offer enough improvements for me to go outside of my natively distributed yum version.

Also, aside from a few changes to the registry and local security policy that had to be made on the client side of the machines, the migration was fairly painless.

The first change resolves the issue of Windows 7 being able to find the domain for insertion, and the security policy solves the issue of Domain Trust at login.  It’s also wise to disable the password reset of the machine to DC to avoid potential relationship issues.  I’d not seen this issue myself, but until I see a confirmation it’s resolved (supposedly coming in samba 4) I’ll err to the side of caution.

My next step will be to integrate Open LDAP functionality into the DC, and an Apache http server.  I assume these will be fairly painless projects, but for risk of breaking my current domain environment I’ll need to wait till I have the time to deal with a potential ldap migration failure.  I also don’t have a strong enough list of pros for it since this is just a home network.  Mind you it’s more sophisticated than the average home network, it just seems a bit over engineered.  As for the Apache server, I really want to get back into some web development so I’d like the internal server for development purposes….

 

service httpd start

Ok, so now I’m running an Apache server off my server as well.  Linux is so hard.

 


 

High point #2 Admin Studio 10

So I was in Houston last week.  I’m now “officially” trained to use Admin Studio 10 for package (msi, app-v, xenapp, and thinapp) development, repackaging, and migration.

So what does that mean?

Well as most of you know I work with a product from Microsoft called SCCM.  One of the primary features of SCCM is application deployment.

So what is application deployment?

Simply put, it’s installing applications to multiple machines over a network.

Ok, I think I see.  So why would you need to do package development to deploy packages?

Well, you don’t have to.  One could feasibly shoehorn an installer given by a vendor, but ideally you want to build out a standardized installer or load for your company.  For us that means I’ll be building MSIs, MSTs, and App-v packages.  As well as isolating application installs that might otherwise break functionality of OTHER applications they share hard drive space with.

Wait, what?  Isolate, break, huh?

Almost all applications rely on libraries.  Think of them as a set of shared instructions that applications go to when asked what to do.  Well in most cases these libraries are shared by multiple applications.  And, sometimes one application wants a vanilla library, and another wants a chocolate.  Well these apps will fight, and one of them will win and another one will lose.  By isolating them I can give them what they want so they don’t break the system, or each other.

Our company will also leverage App-v packages which are essentially virtualized installs of these applications that, although they run locally on the machine, they are actually virtualized (or encapsulated) and are separate from the actual operating system.  Xenapp and Thinapp do the same thing.  I’m particularly excited about application virtualization, it can come with a bit of overhead, but it’s nice and contained.

Ok, I stopped caring somewhere around chocolate and vanilla.

Yea I figured as much.  Either way, it is a tangible notch to my hard skill set and I’m glad that I was able to get it done.

 


 

 High point #3 Gospel in Life

What does a Gospel centered life look like?

What does it mean to be in the world but not of the world?

Is the Gospel as narrow minded to culture as people often proclaim it to be?

What does a Gospel centered community look like?

These are part of the current bible study I’m involved in with my brothers and sisters in Christ called Gospel in Life by Timothy Keller. It’s a great study that forces you to take a look at your heart, your life, and your community and compare it to what and how it is defined in the Gospel. I would recommend this study to anyone who is a believer. Even if the information isn’t new to you, as most of it hasn’t been for me, it’s still food for the soul. A reminder of the higher purpose we are called to as Christians.

Truthfully, I’d encourage non-believers as well to read this study. If for nothing else, than to hold Christians accountable to the teachings that we claim to believe.

 


 

High Point #4 Ignoring my Family

I’ve taken way to long to blog this, and my wife has informed me that I should blog about how I’ve ignored my family, to blog.

When she’s right she’s right.  Thank God for her gentle reminders.

 


/begin spill

I’m not really sure where to start on this, but I feel compelled to talk about how incredible my wife is. 

She consistently supports me when I feel like I’m in over my head.  She allows me to lead, and remains respectful in her dissent.  She maintains and controls what would other wise be anarchy in the home.  She’s an amazing mother, nurturing, and disciplining in equal and proper proportion.  Selfless in her service to her family.  She seeks to find what it is that brings myself and her children the most joy, and works towards those ends.  Her love is a beautiful and humbling thing to behold. 

My wife has a bead on me, and is truly my best friend.  She challenges me to push beyond what I would normally settle for, and is continually used to temper and humble me.  She’s the one person I want to go to bed with, and the one person I want to wake up next to.  I can’t imagine being apart from her, or trying to face this world without her.

Do we fight?  Yes.  Do we always agree?  No.  Do we both love God and trust him to lead us?  Yes.  Do we face trials? Yes.  Does that matter?  Yes. 

God knows what he is doing, and he knew what he was doing when he brought us together.  It pains me greatly that knowing joy through my wife, and my children, I would so quickly have (and did at times) settled for less growing up.  It also makes me realize, this joy pails in comparison to that which I will feel when in the presence of our father.

/end spill

My daughter Maggie, who I’ve mentioned on here before, has some major issues (undiagnosed as of yet) that have caused her considerable developmental delays.  This past Sunday was a major breakthrough for her, and my wife has done a fine job of summing it up for those interested in reading it.

As a Systems Engineer/SCCM Administrator I spend a lot of time parsing through data, and assisting support technicians in tracking down failing assets.  Now mind you, I have plenty of reports that give me the information I need to identify the machine and users and techs responsible etc, but what happens when I get a random list of employee names from a project manager that has 0 access to user ids or asset numbers for machines?  Well, I have to find that information, then spend time later pointing them to resources I’ve made available for them; but that’s another topic….

Anyway, I face both problems, I’ll receive a list of userids or usernames and have to resolve them one against another.  Well thanks to powershell I’m able to do so quickly and easily through profile functions.  Now, I’ll explain the benefits of profile functions after the code below:

 


Import-Module activedirectory

#——————————————————————–
Function Get-UserName {
[CmdletBinding()]

PARAM($USERID)
Get-ADUser $USERID | select name
}
Set-Alias gun Get-UserName
#——————————————————————–
Function Get-Userid {
[CmdletBinding()]
PARAM([string]$NAME)
$NAME = $NAME + “*”
    Get-ADUser -Filter {Name -like $NAME} | select samaccountname,name
}
Set-Alias guid Get-Userid
#——————————————————————–

 


 How do I use profile functions?!?

Powershell, much like the BASH shell in Unix/Linux, has a profile “script” so to speak at startup.  There is a global one found at:

  • %WinDir%\System32\WindowsPowerShell\v1.0\Profile.ps1
  • %WinDir%\System32\WindowsPowerShell\v1.0\Microsoft.PowerShell_Profile.ps1
  • %WinDir%\System32\WindowsPowerShell\v1.0\Microsoft.PowerShellISE_Profile.ps1

The same filename syntax is used for the user profile versions:

  • %UserProfile%\My Documents\WindowsPowerShell\Profile.ps1
  • %UserProfile%\My Documents\WindowsPowerShell\Microsoft.PowerShell_Profile.ps1
  • %UserProfile%\My Documents\WindowsPowerShell\Microsoft.PowerShellISE_Profile.ps1

See a pattern?  Simple enough right?  None of these profiles exist by default though, they must be created.  The names are fairly indicative of what they control, but here’s a breakdown:

  • Profile.ps1
    • This governs startup of both the standard powershell, and the ISE.
  • Microsoft.PowerShell_Profile.ps1
    • This governs startup of the standard powershell console only.
  • Microsoft.PowerShellISE_Profile.ps1
    • This governs startup of the ISE powershell console only.

Simple enough right?  Now, for the sake of simplicity, lets build a current user version of the profile.ps1 and save the above code to it.  Make sure you’ve installed the activedirectory cmdlet module provided with windows 7. Now launch powershell and viola you should now have the cmdlets:

  • Get-UserName
  • Get-UserID

and their aliases:

  • GUN
  • GUID

Ok, now what?

Here’s the thing about profile functions.  You can treat them like cmd-lets now.  That also means that you can script against them.  Consider them a static variable for every powershell session that you have configured with this profile.

Pretty cool huh?  One of the most powerful features of the shell is it’s configurability, and profile functions and aliases are the tip of that spear.

In the case of user name capture, or id capture, I’m but a simple gc and for-each statement away from processing the list given to me.

I hope this helps broaden your practical understanding of profiles, and gets your creative juices flowing for building your own administrative tool kits.  Happy scripting.

I’m not really sure WHAT inspired me to come back and give it a try again…

When it first released and I bought it (being a long time fan of Turbine games) I really enjoyed it.  The game offered multiple layers to it’s (at the time only) PvE element for both customization and character development, it had a rich overarching story telling system (similar to the now defunct AC2), and great universe integration.  It had about everything I enjoy in an MMO, but for whatever reason, it didn’t grab me.  Perhaps it was due to the clunky skill systems, or the over all busy nature of the games complexity, but it just felt wrong after I got past my 20s/30s in the game.

Navigation was a headache, and often times, the little to no reward I started seeing from the quest lines began to leave me wanting more.  The amount of work required to do basic things, such as combat, also began to wear on me (I was a loremaster, which is a very inventive great class). 

However, several expansions, engines, and a pay model change later I’ve decided to give it a go again; here are my initial impressions upon returning (some of these I’ve experienced from recent jaunts back as well):

  • Graphics have improved
  • Character responsiveness still not what I’d like to see
  • Storylines have become richer
  • Customizations have branched further
  • PvP is a nice addition, but meh
  • Soloing feels easier
  • Free to Play model seems implemented fairly well
  • Long term game play feels more promising than before

So lets discuss these points a bit more.

DX11 has been integrated, aside from some differences in the shadows, soft particles, and some interactive water effects (not sure why this wasn’t done prior to DX11) I don’t see a huge difference from the previous DX10 and DX9 iteration.  Textures (although high res versions have been available for a while) still don’t offer anything new, no tessellation, I don’t suspect or expect them to redo all the in game textures and engine, especially since I already find the game quite beautiful but the tech in me always wants to see rendering boundaries pushed.  Mind you I’m on an SLI rig that is DX11 capable, I WANT to make use of that when I game.


 

Character responsiveness has always been a bit of a nagging point for me in Turbine games since their original Asheron’s Call.  I can only assume it’s something to do with their code that requires server response before the client will report movement.  Most online games allow the client to dictate to the server it’s position and the server simply analyzes that and agrees or disagrees with the client.  This is called client-side prediction and has been in use in multiplayer games since the days of Quake at least.  Wikipedia states that Duke Nukem 3D used it as well, but my first real taste of the difference came from shifting out of native Quake DM into QuakeWorld DM where it existed, but I digress. It might even be that Turbine engines USE a form of client-prediction that requires some sort of start receive message before engaging client control, I don’t know, but it causes the client side experience to feel delayed to some extent.

So what does that all mean in a practical scenario? It basically means, when I press forward, either I move forward, or I have to wait a split second or more before my character moves forward.  Both can create unfavorable gaming moments, but I feel that the method in place in Turbine games has been problematic since it’s inception, especially given the responsive nature of their game mechanics.  The thing of it is, in their current design, you are less likely to be called back to a previous position (rubber banding) but rubber banding generally only happens in the most extreme of latency/packet loss cases.  So to avoid rubber banding (I suppose) they verify client input prior to client output, and I see a delay before I can change my X Y or Z position in the game world. 

I would be remised though if I didn’t mention it’s game integrity benefits though as well.  It protects the server from being deceived by client-side “trainers” or utilities that can report illegal positions used to exploit game mechanics.  Anyone who’s played WoW and knows about people porting and speed hacking etc, these are fundamental vulnerabilities to that technical design.  Tolerances usually exist in client prediction to allow a client to get from point a to point b without having to report every step across the grid.  That tolerance NEEDS to be there or you would see a lot of rubber banding, this is what allows smooth game play on really bad connections.  However, it’s easy to exploit that relationship by passing bogus packets to the server.  Both require creativity to overcome their hurdles, and they both do so well enough.  For me personally I feel with client prediction you open yourself to more administrative headaches in an MMO, but a better customer experience.  So I can’t help but feel it’s non-use is a form of laziness at the cost of the gamer.  One could reason it improves customer experience by insuring a level playing field but lets just move on.


 

Storylines, customizations, soloing, and PVP aren’t NEW features per say, but they are features that didn’t exist or have become more robust since it’s release in 2007.  They’ve got 2 expansions and a 3rd on the way so there has been and will still be growth in this game.  It, like a fine wine, has matured rather nicely.  I’ve also been a fan of Turbine’s story telling, and LotRO is no different, and only continues to prove (to me) their mastery in the medium of engaging RPG content in an MMO.  They’ve revamped their starting story lines, and added more tie ins to their quest chains, they introduced new methods for questing/instancing/booking called skirmishes as well.  I could go on for a long time about all the methods they have taken to make their storylines relevant and effective to meet game play but it’s something one has to experience I think more than read about.  The addition of their PvP system (called PvM for Player Versus Monster) even insures story integration into their game by forcing players to spin off new evil characters strictly for PvP.

The other aspect of the game I’ve always found intriguing is their deeds, titles, outfitting, traits, and dying systems.  All offer a robust amount of options for character diversity in their own right, but can really offer diverse customizations when the sum of all parts come together.  Mind you, like all MMOs, people will MIN/MAX so some of the traits etc become pretty cookie cutter for what is used, but it’s not from a lack of options that’s for sure.  They’ve continued to add to these systems, and at times it leaves my head swimming trying to keep track of them all, I tend to be a meta gamer so information overload is definitely something I suffer from when reviewing the possibilities.

The solo aspect of the game also seems to be more realistic than it was at release.  Not so much that you can check out when you are playing, but enough that one can keep a decent rate of progression while going at it alone.  Also some of the earliest content that was at one time a guaranteed group event has been scaled back.  Some may complain it’s TOO easy now, and they may be right, but I feel it’s found a sweet spot.


 

They’ve also converted to a Free to Play gaming model which seem to be all the rage now with MMOs (Thanks Korea!).  For anyone not familiar with a standard F2P gaming model it’s simple, offer a game for free, gut some features out and reserve them for 1) subscribers 2) one time game purchase 3) micro transactions.  In a nutshell, like selling crack.  The first one’s always free!

But seriously, it’s a clever business model, for a guy like me it gives me a demo of what I’m going to invest in and leaves me the option of giving my monthly sub since I’ve no issue with that (and haven’t since I really started into MMOs back in 97/98).  There is also a warm fuzzy seeing an itemized list of things you are getting for your money.  Mind you, it’s all nonsense and I am aware of that, but “if I pay monthly I get…” definitely passes through my mind as a comfort statement when I’m looking at F2P games.  This one of course being no exception, I’m not a huge fan of micro transactions, I’d rather lease the service than commit to it.

At any rate, it’s flexible, and playable even if you want to go in on the cheap.  Kudos to them for making that transition, and congratulations on their success with it.


 

Overall I feel the long term playability of the game has vastly improved, but it’s definitely got it’s competition like all other games.  There appears to be plenty of high end content and customizations to chase after.  There’s also multiple facets to their storylines as well that are worth exploring that I think give incredible replay value to their game.  I suppose I’ll keep going with this for a while in my free time as my fill in game.

If you are interested, look for me, or mail me in game on either Lotekend or Jahosi.

Link!!11!1!

The job market continues to dwindle, government spending continues to rise, and people continue to go hungry.  Marriages crumble, lives are shattered, and hearts are broken.  Wars continue, and families fear for the safety of their loved ones.  Housing market falls, your monetary value shrinking with it, and your bills increase.  Traffic’s at a stand still, gas cost way too much to refill, and it’s all starting to make you feel ill.

So, let me ask this.  What is going right?

Two things we discussed yesterday in church, and it’s wholly gospel related.  Sovereign God, and God Centeredness.

As we see what is falling apart around us, failed machinations that our own sin filled hands have wrought, do we see what he is building?  If God is good and His will is perfect for the good of those who He has called to His purpose (glory); why aren’t we lamenting at his great work in us and around us?  If God is sovereign and we profess his sovereign nature, why don’t we get excited about the possibilities of what is to come when those derailments happen?  Why do we worry so much when we know that He is enough, and that our needs will be met. 

The answer?  God is not enough.

At least that is what our actions and our thoughts cry out as we fight and worry and complain about what is upon us, as if it were something we could control to begin with.  The chief end of man at that point becomes, survive at any cost.  Your focus is you and you’ve abandoned the God who made you.  I’ve abandoned the God who made me.

The truth of that statement is so simple, yet so profound, to realize that you continually fail.  That thought should invoke inside the Christian a heart of repentance and an awe for the grace that has been bestowed upon us.  To realize that we are incapable of saving ourselves, of being righteous and as God centered as we should.  We should be bursting at the seams with joy, to know that we are truly loved and forgiven.

So why aren’t we?

The only answer I have for that is one I find through prayer and scriptural meditation.  I’m designed to worship, but my sin nature drives me to seek immediate gratification.  I want the next best thing, not the one right thing.  My heart is fickle and prone to wander; and love like anything important, requires work.  I have to continually seek his face, to focus on what was done for me, and take stock of what is being done FOR me, and shift the perspective away from done TO me.  We also need to break away from our relative view of what is best for us and understand that we can’t know all angles.  Our God is good, and what is in store for us will be of like nature, and that is something we can rest in.

Johan Arwidmark just posted today a quick guide on finding/extracting the Trace64.exe log reader from CM 12.

Ok, why does that matter?

Because reading logs inside PE with notepad is horrible…..

notrace 

VS.

 

trace

 

Have a great day!

I haven’t written a scripting post in a while, but I’ve wanted to.  So in keeping with the spirit of my stick to the script posts lets look at something that is common among all scripting languages (even if the syntax isn’t).

Let’s talk about strings…….

 kitty-yarn

Awwww, but no.  These kind of strings.  In the case of scripting, I think the best way to think about it is, text, what you are reading or able to read.  They aren’t used mathematically (usually), but can and will be a huge component in your scripting.  Especially when automating things around a desktop or server environment.

Oh really?  Yes, really.  General uses for strings in a script are:

  • User messages
  • Reporting or logging
  • Comparisons
  • Explicit paths
  • Application execution
  • Conditionals

Ok, so maybe that list doesn’t look that impressive, but when you consider how much of that is done within a script, it becomes obvious the importance of string values to scripting.  It’s also important to recognize that in certain scripting environments, it’s important to define a string value as such so that it can be properly used. 

(Powershell for instance, requires you to properly define a value type to use the relevant functions… but I’m getting ahead of myself.)

So wait?  There are more than strings in a script?  Yes; Strings, Integers, and Booleans are your standard value types. Integers are numbers (math!) and Booleans are True or False.  So given those value types, perhaps it is a bit more obvious how frequently you will use string values?

So lets get into some sample code and evaluate strings some shall we?


VBScript:

strTest = "Hey, I'm a string value"

wscript.echo strTest
'Shows the string value
wscript.echo strTest&", and I've been concatenated to the value."
'& operator joins values
wscript.echo lcase(strTest)
'Lower case
wscript.echo ucase(strTest)
'Upper case
wscript.echo strReverse(strTest)
'Reverses the string
wscript.echo len(strTest)
'Gives the total length of a string
wscript.echo mid(strTest,10,8)
'Returns fix number of characters in string
wscript.echo left(strTest,11)
'11 chars from the left
wscript.echo right(strTest,13)
'13 chars from the right
'----------------------------------------------------------------
wscript.echo inStr(strTest,"a")
'Returns position of string from left to right
wscript.echo inStrRev(strTest,"a")
'Returns position of string from right to left
'----------------------------------------------------------------
a = split(strTest)
'Splits strTest by it's spaces
for each item in a
    wscript.echo item
   'echoes each dimension from the split array
next

wscript.echo a(3)&" "&a(4)

'echoes the split arrays dimensions 3 and 4
'---------------------------------------------------------------

strReturn=inputbox("Here, you try!")

if strReturn = "" then
   wscript.echo "Fine, don't play along"
else
    wscript.echo "So you said: "&trim(ucase(strReturn))&vbcrlf _
    &"Sheesh, no need to shout!"
end if
'---------------------------------------------------------------


Running the above script will give you a better understanding of what I’m about to explain.  I wanted to show some common functions in vbscript (syntax is different but these will be universal functions you will use).  The above are common string manipulation tools

 

Code explained… line by line

First we are defining our string to a variable strTest.  Now “in the wild” as it were, this string could be pulled from an object property, read from a file, registry, user input, output from another application, etc.  It’s best to define a string to a variable though, no matter the method for input.  This of course is the most direct way to do it for our example

Now we begin with the simplest string usage, output.

Now we raise the stakes a bit by joining an additional string value to our current strTest.  This action is known as concatenation.  This is a very common thing with string usage and manipulation.  Building complex values/messages/logs from various predefined and/or dynamically pulled string values.

Our next two examples have to do with manipulating case between upper and lower.  This is fairly self explanatory, and in the interest of string comparisons it’s usually a good practice (and often necessary) to force a case set, especially if the comparison function is case sensitive.

String reversal, this may not seem important initially, but makes a huge difference when you are forced to chop strings up.  The ability to reverse a string can go a long way for string chopping.  Especially if you are dealing with filenames.

The length function is another that may seem arbitrary to some, but allows for great flexibility as well in chopping up strings such as file names.  If you have a fixed number of characters to remove it’s sometimes simpler then splitting the string.  (so I wasn’t completely honest about the math stuff and strings)

Mid, Left, and Right.  These 3 can be used in conjunction with length to return a fixed number of characters from the left right, or middle (specified) of a string.  Here’s a quick easy example:

test="I am 18 chars long"
wscript.echo test
count=len(test)-4
wscript.echo right(test,count)

Very simply, we take the total length of Test and subtract it by 4, then return the sum of remaining characters from right to left of the original string.  In this example we, had a fixed value to subtract, be mindful you could use the length value of multiple strings to achieve the same type of results.

Now, InStr and InStrRev, or “In String” and “In String Reverse”.  These two functions make for great conditionals.  They, along with strComp, are excellent for determining like strings and taking action.  Especially when parsing through files and directories looking for specific returns. 

One of my favorites, especially in PowerShell, split.  Split takes a string, looks for a delimiter (space by default) and breaks the string up into an array.  Why do I like it so much?  Put simply, it allows you to quickly whittle down long path names into a single filename.  It also allows you to quickly and efficiently modify lists of data into manageable formats.  And last but not least, it can easily turn files like csv’s into an array for manipulation.

Finally, user input.  This is pretty self explanatory.  Prompt for input, receive and control input, use input.


In PowerShell, string functions are called like this:

$a=”This is a string value”

$a.ToString()

$a.ToUpper()

$a.ToLower()

$a.Replace(“a “,”my “)

$a.split(“ “)

$a.contains(“string”)

$a.StartsWith(“t”)

$a.EndsWith(“e”)

$a.Length

$a.CompareTo(“this is a string value”)

$a.Length.Equals(22)

$a.CharArray()

$a.PadLeft(“30”)

$a.PadRight(“30”)

$a.Trim()

$a.TrimEnd()

$a.TrimStart()

Given the previous examples in vbscript, you should be able to easily adapt your knowledge to using these in PowerShell.  The idea and purpose is still the same, again, the syntax is just different.


String manipulation inside Bash is, admitedly, a bit more convoluted so I won’t be touching on it in this post.  However I’d highly recommend an online source like: Mendel Cooper’s guide.  Again, the methodology will still be fairly the same, but the syntax will differ.  The largest issue with Bash is the myriad of ways of performing the string manipulation.

 

Anyway, I hope this has been informative for you.  Good luck, and happy scripting!