Skip to content

Posts from the ‘Misc Noise’ Category

2
Jul

Clear an icon stuck on your screen on OSX El Capitan

If you have an icon that remained on the screen over a window and if that icon will not dissappear when you move the window there’s a way to get rid of it by killing the dock. Run from OSX’s Terminal:

sudo killall Dock

Note: Maybe this bug appears on Yosemmite too, I don’t know. And maybe there’s other ways to accomplish this task but well, that’s what I did to get rid of an OSX icon stuck on my screen.

19
Jul

Error: Makefile:: *** missing separator. Stop.

If you get the following error when trying to compile an app using a Makefile:

Makefile:14: *** missing separator.  Stop.

Then the problem is you need two tabs in front of $(CC) line (see the following example):

BINDIR=${prefix}/bin
MANDIR=${prefix}/man
man1dir=$(MANDIR)/man1
 
#CC=clang++ -g
CC=clang++ -g -O3 -mavx
CFLAGS=-pipe -Wall -O
LDFLAGS=-lSDL2main -lSDL2 -I/opt/local/include -L/opt/local/lib
 
all: a.o
 
a.o: main.cpp
	$(CC) $(LDFLAGS) main.cpp -fPIC -o test_app

Note that you will need two tabs, not one, not spaces. On some OSes it might work with one tab.

19
Jul

Install libsdl2 on OSX using MacPorts

In order to install libsdl2 on OSX using MacPorts run:

sudo port install libsdl2
19
Jul

Search for ports using MacPorts on OSX

If you want to search for a port name when using MacPorts system on OSX run the following command:

sudo port search sdl

Previous command will display all ports from MacPorts that contain the name name sdl.

12
Mar

Search a String in a Binary File From Command Line in Linux or OSX

If you want to search for a string in Linux or OSX you can do it from command line (terminal) using string command:

strings -a -t x /bin/bin_file | grep "string to be searched"
2
Dec

Solaris Quick Tips

Here are some Solaris commands you might find useful.

ifconfig -a  # show network interfaces
ifconfig qfe0 10.0.0.2 netmask 255.255.255.0  # configure network interface
ifconfig qfe0 plumb up # activate network interface

If you want to make the change permanent after reboot create the following file: /etc/hostname.qfe0 Also we must add the new interfaces to /etc/inet/hosts file. If you want that card to be configured automaticall using dhcp you will also need to create /etc/dhcp.qfe0 file.

dladm show-phys  # show physical network interfaces
dladm show-link  # show link status for network interfaces
prtconf -pv  # show pci identification details for your hardware

From previous commands you will be interested in vendor-id and device-id. Then using those IDs look into /boot/solaris/devicedb/master file.

modload /kernel/drv/iprb     # load a kernel module
kstat -c net | grep net      # display kernel statistic related to the network
scanpci                      # list pci hardware
2
Dec

Succesfuly Importing a ZFS Pool Read-only when Kernel Panics

If we try to import a ZFS pool and the kernel crashes we can try to import the pool in read only mode:

zpool import -f -N -o readonly=on -o failmode=continue tank
2
Dec

Oracle Solaris 11 Live Media or OpenIndiana Default Password

If you’ve installed Oracle’s Solaris or OpenIndiana and you want to know the default username and password here it is:

Username: jack
Password: jack

You can also switch to root using the following command

su -

The password for root (when using su) will be solaris.

7
Mar

Duke Nukem Source Code Review

There’s an interesting article about Duke Nukem source code. If you are a programmer you might find this article interesting:

http://fabiensanglard.net/duke3d/index.php

16
Feb

Play a Youtube Video From a Particular Position/Time And Not From Beginning

If you want for example to play a video from minute 01 and 30 seconds just add the following line to your URL (your http link):

&t=1m30s

You will notice the cursor (marker) for the video will be positioned at 1 minute and 30 seconds in the video and it will start from there.

This is useful if you want to give a youtube video to somebody else to see it and you want to see it from that potition and not from the start (useful when the video is long).

If you want to start a video embeded with an iframe, just add the following at the end of URL within your iframe:

?start=90

Note that 150 is in second and is the result of 1*60 + 30 (just transform minutes and seconds into seconds).