A Three js example of my land sections idea

I have been neglecting my content on threejs, so I thought it would be a good idea to put an end to that by writing some new content on threejs this week, and edit a few posts also while I am at it. I have all ready wrote a bunch of posts on the very basics of threejs, and although there might sill be more for me to learn about the library itself I think I am at a point now where I should start working on some actual examples using threejs. So to start off this week I thought I would at least start an example that is another way of displaying the basic idea of my Mr Sun game that I have been working on and off for a while.

The basic idea of my Mr Sun game is to have a display object that represents a sun, and then a bunch of land sections surrounding the sun. It is then possible to move the sun object around and by doing so that effects the surrounding land section objects. There is then all kinds of other ideas that branch off from there and I have many projects that are just that. Still the basic idea is simple enough and I think it would not be so hard to make a basic threejs example that is another way to go about creating that basic idea at least.

Read More

Linux Bash builtin command(s)

In Linux bash defines a number of built in commands, there is also the builtin command itself which is also a built in command of bash. This builtin command is useful for creating functions in bash scripts that have the same name as a built in command. However there is also the question of what the built in commands are and how to go about confirming if a command is built in or not. So in this post I will be going over some basic examples of the builtin command, but I will also be doing a general overview of all the built in commands in bash.

Read More

Find if a command is there with the type builtin command in Linux

The linux type command is one of many commands that are built into bash itself, this built in command can be used to find the type of a given command name. When working in the command line interface of a terminal there are a number of differet types of commands. Some commands are actaul files in the form of binaries, or scripts that can be run with another command declared with a shebang. Other commands are not files but functions declared in the body of a bash script. There are a number of commands built into bash itself, inclduing as I have mentioned the type command itself. In bash there are also a number of keywords that are reserved. Also there might be a number of commands that are not even any of these, but an aliaes for a command that may have been set in a bashrc file.

So the type built in command can be used as a way to find out what the type is of a command. In the event that it is an actaul file it can be used as a way to find out where that files is. In addition the type command is also usful to find out of a command is taken or not at all which is usful when it comes to coming up with a name for a command. The type command might not be the end all way to do so, but maybe it is a good start as far as everything that is installed on a system in which the command is used to say the least.

Read More

Linux change directory bash built in command

The linux cd command is what is used to change the current working directory when working in a terminal. The cd command is one of several bash built in commands that are actually part of bash itself, and because bash is a major part of just about every Linux os, as well as posix system in general, it is one of many commands that should be present on just about any posix or unix like system that uses bash as the default shell.

To know the current working directory there is also the pwd command, which is yet another bash built in command. In this post I should also work with that command in a few examples also. After all in order to know where you want to go it is also good to know where you are now, and also it is a good idea to have a way to confirm that you are indeed where you want to be.

The cd command is one of the first commands to become aware of when learning bash for the first time, and it is pretty easy to use, however there are still a few things to cover when it comes to using it. For example there is how to go about changing to a folder that has spaces in the name, and also how to quickly jump the the home folder of the current user. Still this should prove to be a fairly quick basic post though.

Read More

Linux eval bash built in command

The linux eval command is a bash built in command that will take a string as an argument and evaluate that string as if it was entered into the command line. This is a built in command that I find myself using once in a while when working out a bash script there I need to create a string and then run that string value.

The eval command can be given just one string as an argument or more than one string. In the event that more than one string is given then those strings are concatenated together and that final string is what is run as a command. There are some other tools that can be used as a way to call a string as a command in bash including using the bash command itself with the -c option. Also when working out a bash script some times I can just use a string value by itself without having to bother with any additional command. So lets look at a few examples of the bash eval built in command, as well as some related examples.

Read More