Sunday, July 3, 2016

ffmpeg -i infile.* -c:a libmp3lame outfile.mp3

Thursday, June 9, 2016

Nvidia stops working on kernel upgrade (login loop problem) : Ubuntu

It may happen in the machines having latest Nvidia cards to which Ubuntu default repository Nvidia drivers are not compatible, and you might have installed driver from binary file available on Nvidia official site.

When you logout or restart after upgrade system, you get trapped in to login loop. Login window appears but you fail to get in.

Soln:

Ctrl+ Alt + F1

Login to the terminal on screen

$ sudo /etc/init.d/lightdm  stop

go to the folder where you have saved your binary file

$ sudo sh ./NVIDIAfileName.bin --dpkg

Follow the instructions to reinstall it. Restart on completion. You may find that compiz is not working properly. So

$ dconf reset -f /org/compiz/
$  unity --reset-icons

----------------------
QED

Thursday, February 25, 2016

Reset Compiz

dconf reset -f /org/compiz/
setsid unity 

Saturday, February 20, 2016

My First make file which works

# Define required macros here
SHELL = /bin/sh

CFLAG = -Wall -g
CC = gfortran
INCLUDE =
LIBS = -lm

# Write program dependency and main program

SRCS = SubProg1.f90 SubProg2.f90 SubProg3.f90 SubProg4.f90 SubProg5.f90 SubProg6.f90 MainProg.f90

OBJS = $(SRCS:.c=.mod)

MAIN= MainProg

.PHONY: depend clean

all:$(MAIN)
@echo  Simple compiler named mycc has been compiled

$(MAIN): $(OBJS)
$(CC) $(CFLAGS) $(INCLUDES) -o $(MAIN) $(OBJS) $(LFLAGS) $(LIBS)

.c.o:
$(CC) $(CFLAGS) $(INCLUDES) -c $<  -o $@

clean:
$(RM) *.mod *~ $(MAIN)

depend: $(SRCS)
makedepend $(INCLUDES) $^


Thursday, February 5, 2015

Not so frequently used keywords c++

alignas, alignof, and_eq, asm, auto, bitand, bitor, catch, char16_t, char32_t, compl,  constexpr, const_cast, decltype, dynamic_cast, enum, explicit, export, inline, mutable,  noexcept, not_eq, nullptr, operator, or_eq, protected, register, reinterpret_cast, short, signed, sizeof, static_assert, static_cast, template, this, thread_local, throw, try,  typeid, typename, union, unsigned, using, virtual, volatile, wchar_t, xor, xor_eq


Very important: The C++ language is a "case sensitive" language. 


Storage classes

The storage for variables with global or namespace scope is allocated for the entire duration of the program. This is known as static storage, and it contrasts with the storage for local variables (those declared within a block). These use what is known as automatic storage. The storage for local variables is only available during the block in which they are declared; after that, that same storage may be used for a local variable of some other function, or used otherwise.

But there is another substantial difference between variables with static storage and variables with automatic storage:
- Variables with static storage (such as global variables) that are not explicitly initialized are automatically initialized to zeroes.
- Variables with automatic storage (such as local variables) that are not explicitly initialized are left uninitialized, and thus have an undetermined value.


Source: C++ tutorial

Tuesday, February 3, 2015

Change terminal work place to look like [02:43:14]/h/r/Desktop:

PROMPT_COMMAND='pwd2=$(sed "s:\([^/]\)[^/]*/:\1/:g" <<<$PWD)'
export PS1='\[\033[1;35m\][\t]\[\033[1;33m\]$pwd2\[\033[1;36m\]: '


Put the above two lines in the .bashrc file and re-login. Change \numbers to edit the colour.

Checks column 2, 3 and 4 for any -ve value, and replaces it by +ve.

awk '{print $1, $2<0?$2*-1:$2, $3<0?$3*-1:$3, $4<0?$4*-1:$4}' file1 > file2