Force MacBook to sleep when lid closed and external monitor connected

To force a MacBook to sleep when closing its lid and while an external monitor is connected:

Manually disconnect the Magsafe or power cable, then close the lid. Wait for the computer to go to sleep and then reconnect the powercable.





Make a bootable pendrive macOS installer

Follow this instructions to put a bootable macOS installer on a memory stick:

1. Download the full size macOS installer


Download macOS from a Mac that is using macOS Sierra 10.12.5 or later, or El Capitan 10.11.6

Get rid of hot pink pixels on a Canon camera sensor

Sometimes image sensors on digital cameras develop stuck or dead pixels. Sometimes showing as a bright pink pixel on the jpg image. Canon cameras and probably other brands too have a function to self repair.


  1. Put a fully charged battery in the camera.
  2. From the Menu (Under Advanced Functions) initiate a "Manual Sensor Cleaning".
  3. Wait for about half a minute, then turn off the camera.


This worked on my Canon 50D

Put shared hard drive to idle on OpenWrt

 There are two applications to put a hard drive to idle in Openwrt:

  1. HDD Idle (hd-idle): This option did not work for me.
  2. HD Parm (hdparm): This option worked perfectly, here is the command to use:

hdparm -S 24 /dev/sdb1

The previous command stops the disk from spinning after 2 minutes. 

Find ungrouped contacts on MacOS

Step 1: Create a new "*Smart Group*" by either choosing "File" and "+New Smart Group,+" or press and hold the "Option" key and the click on the plus sign on the bottom left corner.

Step 2: Name your new "*Smart Group.*"

Step 3: Under "Contains cards which match the following:" choose "Card" and then "*Is not member of*" and then "*any group.*"

Step 3: Click "OK."

Then you can just go to that smart group to view the ungrouped contacts.

Two or more document roots using uhttpd


Edit (nano recommended) /etc/config/uhttpd file for uhttpd to support multiple document roots.

# Server configuration
   config uhttpd main
   list listen_http 0.0.0.0:80
   option home /www
   option cgi_prefix /cgi-bin

config uhttpd secondary
   list listen_http 0.0.0.0:81
   option home /www/fusionpbx
   option cgi_prefix /cgi-bin

# ...


Add this line in the appropiate option to serve php:

option 'index_page' 'index.php'

also, root_doc on php.ini should be empty

Remove failed prerm script on OpenWrt

To uninstall lighttpd package intro the following command in ssh:

opkg remove lighttpd --force-remove

Switch to raw on Apple Photos

After you have clicked "Edit", select "Use RAW as original" under the Image menu. When you close the edit session, the thumbnail will now show "R" on the stack instead of "J", and the raw version will open the next time you edit that photo.

Sync iBooks downloaded on iPhone or iPad to computer with iTunes

To transfer purchased books from iPhone/iPad to computer, go to iTunes File > Devices > Transfer Purchased

Put router with OpenWrt into repeater mode

Go to address 192.168.1.1 in your browser to access OpenWrt configuration:

To scan for wifi signals and join the signal to repeat: OpenWrt menu -> Network -> Wifi -> on "Wireless Overview" clic "Scan" button.

A list of available networks will appear, then clic "Join Network" button on the right of the selected network.

"Join Network: Settings" screen will appear, then intro the wifi password of the network to join in "WPA passphrase" then clic "submit" button.


Clic "Save & Apply".

... Wait for the changes to be applied.

On the Wireless Overview screen clic the "Add" button to create a wifi network where all your devices will connect.

On the Wireless Network: Master "wifi_name" (radio0.network2) scroll down to Interface Configuration and enter the data of your new network:

Under General Setup tab:
ESSID: "wifi name"
Mode: Access Point
Network: tick "lan"

Under Wireless Security tab:
Choose Encryption: WPA2-PSK
Key: "your_wifi_password"

Clic "Save & Apply" button

------

To put a static route to access the router in the OpenWrt main menu select "Network" -> "Interfaces"

On network "LAN" clic "Edit" button

Put IPv4 Address: 192.168.0.1

Clic "Save & Apply" button

Press the restart button of your router.

How to revert back an OpenWrt router configuration

Your router has been misconfigured and you can't access your router anymore. To fix it you need to do a restart process. Here are the steps:

Put your router in failsafe mode:


Set your PC ip: 192.168.1.2 and subnetmask 255.255.255.0 and gateway 192.168.1.1 (computer may need to restart)

Power off the router

Disconnect the WAN cable

Only connect your PC Ethernet cable to ETH0

Power On the router

Wait for the router to start the boot sequence (SYS LED starts blinking)
When SYS LED is blinking, hit restart button (SYS LED will be blink in a faster rate means your router is in failsafe Mode) (you have to hit the button before the router boots)(you may need to press the restart button twice to enter failsafe mode)


-----

'Factory reset' to default config


Enter console commands:
(You may need to activate Telnet on Windows)

# telnet 192.168.1.1

(wait for the OpenWrt BusyBox front page indicating "FAILSAFE MODE active)

 === IMPORTANT ============================
  Use 'passwd' to set your login password
  this will disable telnet and enable SSH
 ------------------------------------------


BusyBox v1.19.4 (2013-03-14 11:28:31 UTC) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 ATTITUDE ADJUSTMENT (12.09, r36088)
 -----------------------------------------------------
  * 1/4 oz Vodka      Pour all ingredients into mixing
  * 1/4 oz Gin        tin with ice, strain into glass.
  * 1/4 oz Amaretto
  * 1/4 oz Triple sec
  * 1/4 oz Peach schnapps
  * 1/4 oz Sour mix
  * 1 splash Cranberry juice
 -----------------------------------------------------
root@(none):/#





# mount_root (to mount the JFFS2 partition)

# firstboot

# rm -r /overlay/*  (or /overlay/upper/* on some routers)

# mtd -r erase rootfs_data (this will reboot the device as part of the process)



-----------

Once your router restart go to address: 192.168.1.1 in your browser


That's it.


How to Use a Router as a Repeater


App developer, increase your installs

Let's say you are an app developer, and you want to boost a little bit your income from the app without putting much work.

Make MAMP portable in MacOS

How to install MAMP in your external disk: