what is the function of /etc/apt/sources.list.d?

The function of the /etc/apt/sources.list.d directory is as follows: Using the directory you can easily add new repositories without the need to edit the central /etc/apt/sources.list file. I.e. you can just put a file with a unique name and the same format as /etc/apt/sources.list into this folder and it is used by apt. In order … Read more

Commandline overwrites itself when the commands get too long

I’ve just solved this myself. It was just some color escapes in the PS1 command prompt: LTGREEN=”\033[40;1;32m” LTBLUE=”\033[40;1;34m” CLEAR=”\033[0m” LIGHT_GRAY=”\033[40;1;33m” export PS1=”$LTGREEN\u$LTBLUE@\h:$LIGHT_GRAY\w$CLEAR ❯ ” The issue is that the color literals are not enclosed in brackets. Placing escaped brackets around them fixes the issue entirely: LTGREEN=”\[\033[40;1;32m\]” LTBLUE=”\[\033[40;1;34m\]” CLEAR=”\[\033[0m\]” LIGHT_GRAY=”\[\033[40;1;33m\]” export PS1=”$LTGREEN\u$LTBLUE@\h:$LIGHT_GRAY\w$CLEAR ❯ ” Hope this … Read more

/usr/bin/time –format output elapsed time in milliseconds

One possibility is to use the date command: ts=$(date +%s%N) ; my_command ; tt=$((($(date +%s%N) – $ts)/1000000)) ; echo “Time taken: $tt milliseconds” %N should return nanoseconds, and 1 millisecond is 1000000 nanosecond, hence by division would return the time taken to execute my_command in milliseconds. NOTE that the %N is not supported on all … Read more

MySQL Daemon Lock issue

I just ran into this. The mysql install was a little weird and was missing /var/run/mysqld/ MySQLd was attempting to create the socket and lock file but the parent directory was missing. I simply created the directory sudo mkdir /var/run/mysqld chowned it to mysql sudo chown mysql:mysql /var/run/mysqld I was then able to start mysqld … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)