Saturday, December 21, 2019

Basic Unix commands of Frequent use


Following are some commands which you will use very often->

Suppose you are not able to deploy your ear successfully ,or your application is running very slowly; then most definitely you are short on space.

1) Use the following 2 commands to see the available space and memory->
$ df -h (Space)
$ free -m (Memory)

2) Check "class file" exists in which jar file.
$ find -name "*.jar" | xargs grep CitiNotesDataUtility.class

3) Find all instances of the specified process currently running.
$ ps -ef | grep processName
$ ps -ef | grep processName | grep java (java processes)

4) Kill Process : kill
$ kill -9 processId

5) List Directory Contents : ls
$ ls -a

6) Display Manual pages : man <command>
Linux has as extensive set of online documentation. They are referred to as manual pages.
$ man ls

7) Concatenate files: cat
$ cat file1 file2 > newFile

8) Current working directory
$ pwd

9) List all the current running processes
$ ps

10) Change Directory
$ cd /usr/bin
$ cd.. (go back)

11) Make Directory : mkdir
$ mkdir newDirName

12) Remove files and directories: rm
$ rm file.txt

$ rm dirName


Anti-Patterns in Software Development

Anti-patterns are certain patterns in software development that are considered bad programming practices.

Anti-patterns are the opposite of design patterns and are undesirable.

Some Anti-Patterns:

1) Bleeding Edge : Use cutting-edge(latest) technologies that are still untested or unstable leading
to cost overruns, under-performance or delayed delivery.

2) Cash Cow : A profitable legacy product that often leads to complacency about new products.

3) Micromanagement : Many times a team is rendered ineffective due to excessive observation,
supervision and hands-on involvement (lack of trust).

4) Mushroom management : Keeping employees in the dark and feed manure.

5) Seagull management : Management in which managers only interact with employees when a problem arises - they fly in, make a lot of noise, dump on everyone, do not solve the problem,
then fly out.

6) Smoke and Mirrors : Demonstrating unimplemented functions as if they were already implemented.

7) Brooks Law : Adding more resources to a project to increase velocity, when the project is already
slowed down by co-ordination overhead.

8) Big ball of mud: A system with no recognizable structure.

9) Interface bloat: Making an interface so powerful that it is extremely difficult to implement.

10) Database-as-IPC: Using a database as the message queue for routine inter-process communication where a much more lightweight mechanism would be suitable.

11) Circular dependency: Introducing unnecessary direct or indirect mutual dependencies between objects or software modules.

12) God object: Concentrating too many functions in a single part of the design (class).

13) Busy waiting: Consuming CPU while waiting for something to happen, usually by repeated checking instead of messaging.

14) Caching failure: Forgetting to clear a cache that holds a negative result (error) after the error condition has been corrected.

15) Cargo cult programming: Using patterns and methods without understanding why.

16) Hard code: Embedding assumptions about the environment of a system in its implementation.

17) Lava flow: Retaining undesirable (redundant or low-quality) code because removing it is too expensive or has unpredictable consequences.

18) Repeating yourself: Writing code which contains repetitive patterns and sub-strings (duplicate code); avoid with once and only once (abstraction principle)

19) Spaghetti code: Programs whose structure is barely understandable, especially because of
misuse of code structures.

20) Copy and paste programming: Copying (and modifying) existing code rather than creating generic solutions.

21) JAR hell: Over-utilization of multiple JAR files, usually causing versioning and location
problems because of misunderstanding of the Java class loading model.
Home