LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-29-2015, 02:23 AM   #1
andul
LQ Newbie
 
Registered: Nov 2015
Distribution: Debian Wheezy
Posts: 20

Rep: Reputation: Disabled
Post What are templates?


Not even sure if that's what they are called...

Anyway, I wanted to make a certain wifi network work with Debian, so I searched up how to do this. One guide that worked basically had me go into the /etc/wicd/encryption/templates folder on my file system and create a file with no extension that looked like this:

name = PEAP with MSCHAPv2
author = ElitestFX
version = 1
require identity *Identity password *Password
-----
ctrl_interface=/var/run/wpa_supplicant
network={
ssid="$_ESSID"
scan_ssid=$_SCAN
key_mgmt=WPA-EAP
eap=PEAP
phase2="auth=MSCHAPV2"
identity="$_IDENTITY"
password="$_PASSWORD"
}

I then added a line with the name of the above file to another extension-less file called "active." This changed things in the program I was using (wicd). I was really amazed by this, I even changed the names of things in these files around to personalize some stuff.

Excuse my noob-ness, but what are these called? They literally allow for configuration of stuff in wicd, it's really awesome. Can I do this with any program in Linux? I want to learn more about how to work with these, but unfortunately Google searches don't really give me what I'm looking for (so maybe I got the name wrong).
 
Old 11-29-2015, 02:38 AM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196
Welcome to LQ!

What you have touched like a live-wire is the simple power of Unix-like operating systems, of which GNU/Linux is one!

It is refreshing to see a noob touch the awesomeness of it all and be excited - most simply complain about how hard it is!

A design constraint of *nix systems is that everything is text. Configuration data should be plain text, human readable and human editable. It is a core idea which when adhered to unleashes the power of the hardware and the OS!

These are just common config files, some may call them templates, but mostly they are called config files.

You can learn this for most programs, but sadly some newer programmers do not respect this as a design principle and think that they know better, so you sometime see things like "This file is machine generated - do not edit!".

If you like this approach then you might want to give Slackware a try! It is the most Unix-like Linux and you will never see any "Do not edit this file!" nonsense, you are encouraged to make it just they way you like it - great stuff!

Last edited by astrogeek; 11-29-2015 at 02:44 AM.
 
1 members found this post helpful.
Old 11-29-2015, 02:50 AM   #3
andul
LQ Newbie
 
Registered: Nov 2015
Distribution: Debian Wheezy
Posts: 20

Original Poster
Rep: Reputation: Disabled
Hey, thanks for the response!

So would these be called configuration files?

Where would I learn how to write these? Are they all of the same language, or are specifications usually in a program's README file, or something like that? (Trying to think of writing these as programming.)

This is my first time being exposed to this. Would I be able to find more if I read about Unix-like systems?

Also, is editing these sorts of files also possible in OS X for Macs, since it's Unix-like? I know OS X is proprietary, so I wouldn't think they'd allow users to edit software like this.
 
Old 11-29-2015, 03:20 AM   #4
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196
Yes, they are usually just called configs or config files.

No they are not all alike, although there is quite a bit of shared style in many of them.

You really just have to learn what is recognized by each application, and of course read the man pages as a good place to start. Also the READMEs when they are available.

To get an overview of how many are commonly avaliable just look down the various paths in the /etc/ directory tree which is the main (but not only) location for system configs - but be careful about just trying to modify things - you can easily break your system too!

Some imporant ones to look at, just off the cuff:

Code:
/etc/hosts - see man hosts for details

/etc/resolv.conf - see man 5 resolv.conf

/etc/inputrc - controls many aspects of your shell behavior, see man readline for an introduction

/etc/profile.d/... - location of multiple configs for various applications

/etc/X11/... - runtime configs for the X server

In your home directory...

~/.bashrc
~/.bash_profile - these allow pretty much unlimited customization of your login shell, aliases, keymappings, startup progs...
~./.XDefaults
~./.XResources - Configs for X programs, terminals, colors, fonts, styles, actions

The possibilities are genuinely endless! Well worth learning your way around!
A great resource to learn Linux in general, and which will lead you to many common configs and their uses is the Rute User's Tutorial and Exposition.

OSX, I have no idea. It is built on a BSD Unix base but hides most of the empowering stuff from the poor user.

Last edited by astrogeek; 11-29-2015 at 03:39 AM. Reason: tpos, typs, typos and added comments
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ templates vbx_wx Programming 1 09-26-2010 01:06 PM
C++: using templates Ephracis Programming 2 03-08-2009 01:39 PM
Need help with templates ........ max_rsr Programming 4 04-22-2005 12:53 PM
c++ templates ashirazi Programming 5 07-30-2004 05:17 AM
Templates MGLindsey Linux - Networking 0 07-02-2002 11:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration