UNIX Diary - Psychology, Philosophy, and Licenses
venam
(10-09-2014, 10:53 AM)xero Wrote:
(09-09-2014, 12:21 PM)venam Wrote: Today I had a lot of fun hacking the computers in the library at university...
I found out that it was really openbox and that it ran windows inside Firefox with a citrix plugin.
It was interesting to check the file system without a browser and trying to execute commands without any terminal emulator.

next time try https://addons.mozilla.org/En-us/firefox...-terminal/

Really nice, thanks a lot. I'll try that tomorrow.
EDIT: I don't think that it's what I need.
xero
(10-09-2014, 11:51 AM)venam Wrote: Really nice, thanks a lot. I'll try that tomorrow.
EDIT: I don't think that it's what I need.
sorry, i guess that is a JS only terminal. (i use devtools-term in chrome sometimes, i thought this was the same idea).

the only other plugins i see are:
- terminalRun : https://addons.mozilla.org/en-US/firefox...rminalrun/ but that opens an external terminal, so idk if that will work for you either.
- tanasinn : http://saitoha.github.io/tanasinn/ - looks good, but some heavy dependencies.
- fireSSH : https://addons.mozilla.org/en-US/firefox/addon/firessh/ remote sessions only
z3bra
Dear Unix Diary,

Yesterday I installed my first production server. And it went fine !

I was recently hired as a sysadmin, and had to lead my first project: deploying an ownCloud server for internal use.
The first thing I had to do was to setup a VM to run the Linux server, and then install all the vital components for ownCloud (web server, database, php, and such).
I took me about two days to get it working along with the already existing user base and network shares, but I did it ! The server is now active, and functionnal !
Next task is to make it higly available, and back it up !
xero
dear UNIX diary,
today i showed my boss how to spoof production urls as localhost for offline testing!

at my new job i've been learning nodejs. it's pretty cool writing end-to-end javascript for a project. the idea is that all our clients have a given url (e.g. http://nixers.net) and in the project code we use that url all over the place. when it's time to make a fix it's difficult to test on localhost when all the urls redirect you to the live site. when my co-workers we're talking about how they test, they told me they use a cluster of virtual staging servers that the devops team sets up for us to act as a given domain. i asked my boss why we needed this since we could all do that locally. the secret is editing your hosts file and telling your box to respond as that domain.

- edit /etc/host
- add a new line in this format: ip-address hostname.domain.org hostname
- 127.0.0.1 nixers.net nixers.net
- save the file.
- start the nodejs frontend in the cli
- sudo node app --url http://localhost:4000 --p 80 -w 0

now all requests to http://nixers.net (or in the node world http://nixers.net:3000 - depending on how you setup your dev ports) will redirect to http://localhost/!!!

i got some "brownie points" with my boss for that one! unix to the rescue!
pizzaroll1
The best part is that Windows has an /etc/hosts file too, but it's somewhere in the Windows directory. It's from back when they took all of the TCP/IP stack code from BSD (could have been FreeBSD or NetBSD, or maybe 4.4BSD, I don't remember), I think. But hardly anyone uses it for some reason.
my website: kaashif.co.uk
hades
I've seen someone use the hosts file on Windows before. He was demonstrating, for a Security class, how viruses with Admin priveleges, could cause your legitimate traffic to be redirected to a phishing site. He then demonstrated setting up several sites that looked just like major sites, such as facebook, twitter, and even a bank's website, and then setting up the hosts file to redirect to the lookalike sites. Spooky stuff.

But if the virus is contracted while using a non-admin account, it can't do that damage. He followed up this lesson by reminding the class that it's not a good idea to browse the web and conduct everyday activities while logged in as an admin, which shocked most of the Windows users in the class. And their shock, shocked me - that's basically the equivalent of logging in as root full-time on a *nix system. The amount of ignorance it would take to do that is beyond me.
venam
We were talking about host files a while back. They can be used to avoid spams. For example there's this guy http://someonewhocares.org/ that is trying to make a good list of hosts to block. Also, the host file in this case has been proved to not be that efficient and it's better to use something like adsuck.
xero
(18-09-2014, 12:37 AM)venam Wrote: http://someonewhocares.org/hosts/
holy hosts file batman! there's some good stuff in there. thanx for sharing!
venam
Dear Unix diary,
Today I've set up an account on https://pushover.net/. I recently got a smartphone and I thought it was time to get this thing working so I get notification when I'm away from my main machine. Thus, I've got the api key and wrote a little shell script to do the notif. I tested it at home and it worked perfectly. So I inserted a line in my updater script which fetches new info and manga updates. Then I went to univ and tried checking if things where working properly and it turned out they're not. The port used by the Pushover application is blocked. University ITs are lame.
earsplit
(17-09-2014, 10:51 AM)xero Wrote: dear UNIX diary,
today i showed my boss how to spoof production urls as localhost for offline testing!

at my new job i've been learning nodejs. it's pretty cool writing end-to-end javascript for a project. the idea is that all our clients have a given url (e.g. http://nixers.net) and in the project code we use that url all over the place. when it's time to make a fix it's difficult to test on localhost when all the urls redirect you to the live site. when my co-workers we're talking about how they test, they told me they use a cluster of virtual staging servers that the devops team sets up for us to act as a given domain. i asked my boss why we needed this since we could all do that locally. the secret is editing your hosts file and telling your box to respond as that domain.

- edit /etc/host
- add a new line in this format: ip-address hostname.domain.org hostname
- 127.0.0.1 nixers.net nixers.net
- save the file.
- start the nodejs frontend in the cli
- sudo node app --url http://localhost:4000 --p 80 -w 0

now all requests to http://nixers.net (or in the node world http://nixers.net:3000 - depending on how you setup your dev ports) will redirect to http://localhost/!!!

i got some "brownie points" with my boss for that one! unix to the rescue!

Best way to do this is at an application level though. You shouldn't be spoofing production URLs because it can lead to a greater chance of error. Say you're testing API calls locally and you forget to spoof your domain. You've ended up making them all on production.

What you should do instead is in your routes, associate a host to each controller. In the application configuration, you can set the default host to "production.com" and overwrite it in a development environment.

For instance,
Code:
defaults.json
{
  domain : "production.com"
}
Code:
development.json
{
  domain : "local.com"
}
Code:
staging.json
{
  domain : "staging.com"
}
Where the values in staging + development overwrite settings in default.json.

You can use environmental variables to control this further, and catch the environment in node.
Code:
export APP_ENV=development/staging/production
You can access it in node with
Code:
process.env.APP_ENV

Most importantly, I suggest you implement something like this:
https://github.com/web-napopa/node-reversable-router
And then replace all hardcoded urls with calls to
url('named_route').




Members  |  Stats  |  Night Mode