Raspberry webserver change website name - raspberry-pi

In my browser i can type 192.168.178.33:8000 to access the webpages on my raspberry or
http://raspberrypi:8000/
Somewhere must be set that the web browser translate http://raspberrypi:8000/ into 192.168.178.33:8000 I tried to find a nameserver but I've no idea what or where I can change this
Is there a simple way to change
http://raspberrypi:8000/ into http://whateverIWantHere:8000/

You can edit your hosts file. The location is different for each OS and may also be different for different versions of the OS. Note that you only need to do the changes on the computer where you want to translate it.
Windows 10:
C:\Windows\System32\Drivers\etc\hosts
Linux/Raspbian:
/etc/hosts
Add the following line to the end of the file:
192.168.178.33 raspberrypi
You may have to restart, I'm not sure if the changes will apply immediately. And you can now type 192.168.178.33:8080 in your browser.

Related

How to MFDeploy a configuration file

Colleagues and users testing various features in a program use MFDeploy to install for example "MyApp.exe" onto their Netduino +2. This method works great. Is there a way to also MFDeploy a "MyApp.config" text file so they can set their specific network criteria (like Port#) or other program preferences? Obviously, more robust preferences can be set from desktop software or web app AFTER the connection is established.
After several days researching, I could not find a viable means of transferring a config file via MFDeploy. Decided to add a "/install" command line option to the desktop app:
cncBuddyUI.exe [/help|/?] [/reset] [/discover] [/install:[axisA=X|Y] ,port=9999]]
/help|/? Show this help/usage information
/reset Create new default software configuration
/discover Listen for cncBuddyCAM broadcasting IPAddress & Port (timeout 30 secs)
/install Install hardware specific settings on Netduino+2 SDCard.
port Network port number (default=80)
axisA Slave axisA motor signals to X or Y axis
During "/install" mode, once cncBuddyCAM (Netduino app) network connects to cncBuddyUI (desktop app), the configuration parameters are transmitted and written onto the SDCard (\SD\config.txt).
Every warm boot now reads \SD\config.txt at startup and loads the configuration parameters into the appropriate application variables.
After several weeks of usage, I find this method preferable and easier to customize. Check out cncBuddy on Github.

Proxy setting in gsutil tool

I use gsutil tool for download archives from Google Storage.
I use next CMD command:
python c:\gsutil\gsutil cp gs://pubsite_prod_rev_XXXXXXXXXXXXX/YYYYY/*.zip C:\Tmp\gs
Everything works fine, but if I try to run that command from corporate proxy, I receive error:
Caught socket error, retrying: [Errno 10051] A socket operation was attempted to an unreachable network
I tried several times to set the proxy settings in .boto file, but all to no avail.
Someone faced with such a problem?
Thanks!
Please see the section "I'm connecting through a proxy server, what do I need to do?" at https://developers.google.com/storage/docs/faq#troubleshooting
Basically, you need to configure the proxy settings in your .boto file, and you need to ensure that your proxy allows traffic to accounts.google.com as well as to *.storage.googleapis.com.
A change was just merged into github yesterday that fixes some of the proxy support. Please try it out, or specifically, overwrite this file with your current copy:
https://github.com/GoogleCloudPlatform/gsutil/blob/master/gslib/util.py
I believe I am having the same problem with the proxy settings being ignored under Linux (Ubuntu 12.04.4 LTS) and gsutils 4.2 (downloaded today).
I've been watching tcpdump on the host to confirm that gsutils is attempting to directly route to Google IPs instead of to my proxy server.
It seems that on the first execution of a simple command like "gsutil -d ls" it will use my proxy settings specified .boto for the first POST and then switch back to attempting to route directly to Google instead of my proxy server.
Then if I CTRL-C and re-run the exact same command, the proxy setting is no longer used at all. This difference in behaviour baffles me. If I wait long enough, I think it will work for the initial request again so this suggests some form on caching taking place. I'm not 100% of this behaviour yet because I haven't been able to predict when it occurs.
I also noticed that it always first tries to connect to 169.254.169.254 on port 80 regardless of proxy settings. A grep shows that it's hardcoded into oauth2_client.py, test_utils.py, layer1.py, and utils.py (under different subdirectories of the gsutils root).
I've tried setting the http_proxy environment variable but it appears that there is code that unsets this.

Why is MAMP so slow to apply any change on my local dev sites?

I'm using MAMP (free version) to develop a website locally and it takes about 1 minute to apply any change (for instance, variable declaration). It takes the same time on Firefox, Safari or Chrome even if I load the page without the cache (CMD+SHIFT+R or SHIFT+refresh). Working with the "localhost/" url instead of a virtualhost doesn't change anything…
Does anybody have the same issue and have a solution?
To fix it try this: in your hosts file you need to list all your local dev sites in a space delimited row like so...
127.0.0.1 localhost localsite1.dev localsite2.dev localsite3.dev

setting default directory on raspberry pi

I recently tried to install php on my raspberry pi, and a web server. By doing so the default location of user pi is now var/www, but it used to be /home/pi. How can I change it back to the way it was?
The most proper way is to use Virtual Hosts in the directory : /etc/apache2/sites-available/
The default is pointing to /var/www/
I'm always creating a user for a project and then I point the Virtual Host and I use SuPHP for the security.
To solve your problem, look at the file /etc/apache2/sites-available/default
Edit :
is it a problem related to apache and php or system/unix ?

How to configure a new network interface in Android

I am trying to configure a new network interface on Android tablet (v3.2).
From terminal application I can
"ifconfig eth0 192.168.11.14 netmask 255.255.255.0 up"
and everything works fine (ethernet cable is connected trough USB-Ethernet dongle)
I want to make this configuration persistent, but it looks like there is no 'interfaces' file in Android.
Where is network configuration file located? Do I need to create new one? Where?
Thanks,
yet another late answer... scoured the internet and couldn't find any decent answer until I checked out /etc/init.sh ...
I'm using an Android Oreo vmware image for testing purposes and here are the steps that I used to add static IP to Android on boot:
Open Terminal Emulator (if not present install from Play Store)
type su
type vi /etc/init.sh
type i
look for function do_init()
before the closing curly brace (}), type post_init_network
create new line after the closing curly brace (}), type
function post_init_network()
{
ifconfig 192.168.63.122/24 up
}
change the ip and subnet as needed...
press :wq! to save and exit vi
power of and power on Android.
To check Static IP:
open Terminal Emulator again after power on, type su, then type ifconfig
NOTE: I encounter this issue where I can't get an IP from NAT network using 2 interfaces where the first interface is set to static IP and the other DHCP, just power on and power off Android until you can get an internet connection.
Sorry for the really late answer. This is more for future reference.
If your ROM supports init.d scripts, try writing one for this. Put the file in /system/etc/init.d/, change its access mode and owner/group to 0755 and root:root, respectively.
Your command will be run at every boot, effectively making it persistent.