sKunKbad
Members-
Posts
1,832 -
Joined
-
Last visited
-
Days Won
3
Everything posted by sKunKbad
-
jazzman1, there sure is a lot to learn. I've started reading the LPI Linux essentials exam preparation, thinking that I would just breeze through it, but that's certainly not the case: https://shop-download.linupfront.de/cc/lxes-en-manual-cc.pdf I've only worked on Ubuntu Desktop, Ubuntu Server, and CentOS Server. Right now I'm working as a web dev and design freelancer, and I stay busy, pay the bills, etc. I wouldn't say it's boring, but I'd like to be in a position to do something else. I was thinking to self-teach myself Linux system administration, but wow is there so much to learn. Are you self taught, or study at a school?
-
Thanks for your response. It's odd to me that su and sudo -i would be different, and you are correct. I think that the differences are the PATH and some environment variables, according to this: https://help.ubuntu.com/community/RootSudo#Special_notes_on_sudo_and_shells When I specify a new password for root, I am able to use su. Is there a difference between "sudo su" and just "su"?
-
I've been doing a lot of studying of Linux lately. I enabled the root acount to do some work. When done, even if I logout, close the terminal, or reboot, I can still access the root account without supplying the root password. So what am I not understanding or what am I doing wrong? I don't really need to disable the root account, but this is just a learning experience, and I'm not understanding why I still have access. See below: # I needed to enable root access for something skunkbad:~$ sudo passwd root # I did what I needed to do skunkbad:~$ sudo -i root@ubuntu-Inspiron-3647:~# # I logout from root root@ubuntu-Inspiron-3647:~# logout # I disable the root access per instructions from many internet references skunkbad:~$ sudo passwd -dl root # Root access is still available, even if I close and reopen the terminal skunkbad:~$ sudo -i # I logout from root root@ubuntu-Inspiron-3647:~# logout # Trying to access root via su prompts for password, and old password is wrong skunkbad:~$ su Password: su: Authentication failure
-
How best to send PHP data to a JavaScript client
sKunKbad replied to NotionCommotion's topic in PHP Coding Help
I can only show what I do using jQuery. I don't know how it works otherwise: SERVER (whatever.php) echo json_encode(array( 'response' => 'success' 'a' => 'one', 'b' => 'two', 'c' => 'three' )); JS $.ajax({ type: 'post', data: {}, // You'd normally put stuff in here cache: false, url: '/whatever.php', dataType: 'json', success: function(response){ if( response.status && response.status == 'success'){ alert(response.a); alert(response.b); alert(response.c); }else{ if(response.message){ alert(response.message); }else{ alert('Error on server.'); } } }, error: function(){ alert('Network error.'); } }); -
You know what, I am totally wrong. We aren't using the Google API for converting IP addresses into a location. We are using an IP2LOCATION database. http://www.ip2location.com/ You do have to pay for this though. The HTML5 way being free, it's certainly the way to go. I've noticed that the IP2LOCATION results can be way off too, so it may not be worth paying for.
-
First, you can turn an IP address into geo coordinates with Google's Geocode API: https://developers.google.com/maps/documentation/geocoding/ Next, take those geo coordinates and query your database using a sophisticated query based on the following info: http://www.notaires.fr/sites/default/files/geo_searchjkkjkj_0.pdf That should get you started. I use this to query for properties that are within a certain radius. It works well, and we turned it into a stored procedure to make it run a little faster. Unfortunately, I'm not allowed to share that code with you.
-
How do you suggest to improve this Youtube download site
sKunKbad replied to aditd's topic in Website Critique
Since you are using WordPress, I suggest going to themeforest.net and purchasing one of their premium themes. There is one called Enfold that I really like using. Most of the themes are in the $50 to $60 range, and well worth the money. All of the work that goes in to one of the premium templates could be saving you many hours of work, and you'll have a site that looks great. -
Here you never actually set the $message variable on line 36. There's no way it could be set, because you don't have a message field in your form. So add a message field, and then set the value of $message to the value posted by the form.
- 2 replies
-
- email form
- php form
-
(and 1 more)
Tagged with:
-
I'll admit there are some nice features to Twig, but I'm fully comfortable, fully capable, and very accustom to using PHP in my views. I think a dev has to look at modern template engines and make their own decision. Will it increase productivity? Maybe. Are there great benefits or detriments. Maybe. Asking others if a template engine is the right thing will lead to opinions, and that's what we have here. So OP just needs to dive in and check out some template engines, as well as considering opinions and determining what's right for him/her. Maybe I need to switch gears. Maybe I could do X, Y, or Z. I've found out the hard way that things I was interested in were made obsolete, essentially wasting my time (and the money of my clients). So, I am just cautious when moving towards using a concept, library, plugin, framework, script, etc. I hear you when you say Smarty and Twig are not new, but there's something good about knowing how to code without them.
-
I really don't like the idea of using a template engine. I had wrote out a lengthy explanation why, and then decided to shorten my response to simply "maintenance". PHP tags will always exist, but 3 years from now when X template engine is the hot new template engine, imagine the frustration when you need to update thousands of views to use X. 3 years after that X will be lame, and everyone using Y .... The dev world is such that whatever plugin or awesome code you are using today, it will probably be outdated or obsolete in a few years. I'm not saying you need to use raw PHP, HTML, and JS for everything. I'm just saying that when you overdo it, you're going to pull your hair out in a couple years. This becomes way more important if you are working on scores of client websites. The decision is like that of choosing a PHP framework. 5 years ago you would have had many suggestions to use CodeIgniter, and today CodeIgniter is like the black sheep of frameworks. So should you decide to use Twig, Handlebars, Smarty, or something else: http://www.webresourcesdepot.com/19-promising-php-template-engines/ ? I think your answer should indicate your willingness to deal with the possibility that it will not be desirable in the future.
-
I recommend setting up an installation of WordPress with the theme on your development machine. Compare the output (and JS generated output) by using a tool like Firebug. I imagine, based on my experience with WordPress sliders, that the slideshow is almost 100% generated by JS. Do a global search for nivoSlider and see what you find.
-
It doesn't look like either of these files is related to the slideshow, which is "nivoSlider". I don't understand why you would have to modify the theme's files though. Most premium themes would allow you to control your slideshow from within the administration area, and you wouldn't need any coding experience. What are you trying to do?
-
Using xml feeds to display live odds on website
sKunKbad replied to samjsharples's topic in PHP Coding Help
First, 3.4MB isn't a feed, it's a bad decision. If you must deal with such a feed, pull it in with a cron, and store it on your server so you don't have to call it on every request. Call your cached version. Do you need help with parsing? SimpleXML is super easy. Give it a shot and let us know when you get stuck. -
Permission Denied in php file read when file owner is not apache
sKunKbad replied to snehu's topic in Apache HTTP Server
Linux/Unix type permissions are full of little things to learn. I'll be honest and state that I do not consider myself to have a complete understanding of them. I do have great interest in this subject. I have some permission related questions of my own, but those would be for another thread. -
Permission Denied in php file read when file owner is not apache
sKunKbad replied to snehu's topic in Apache HTTP Server
Probably parent directory not owned by Apache, or parent directory not applied to a group where Apache is member, combined with permission like drwx------. Yes? -
Permission Denied in php file read when file owner is not apache
sKunKbad replied to snehu's topic in Apache HTTP Server
You might also consider using setgid on the directory. Something like: sudo chgrp www-data /path/to/dir sudo chmod g+s /path/to/dir This should enforce that all files created in the directory inherit the www-data group. setgid on directories is often essential (as in the case of using git), so you should read up on it. -
There's a difference between Godaddy basic hosting and most other host's basic hosting. You say that you've never had any issues with their basic hosting, and that just indicates that you haven't tried anything custom enough to notice. Suggesting that people are incapable of managing a website because they have problems with Godaddy is naive. Their hosting is so proprietary in nature, and their customer support is simply a denial that something is wrong on their end (it's always your fault). I can't even name how many hosts I've worked with over the years, and with the exception of one, Godaddy is the worst. That's just my opinion, but I believe if you spend some time searching for complaints online, you'll find more than you can read.
-
I'm working on a website (for free) and the website owner has shared hosting w/ cPanel. When logged in to cPanel, the PHP version can be set to PHP5.5. So I did that. When logged in via SSH, scripts are still running on PHP5.3. I found that /opt/alt/php55/usr/bin/php is a location of php5.5, but when I run my script, it gives an error that mysqli is not found. As far as I know, this is probably just a typical cPanel install. If anyone can point me to the right way to run PHP5.5 from the command line, I'd appreciate it.
-
C and C++ without an IDE on Ubuntu 14.04
sKunKbad replied to sKunKbad's topic in Other Programming Languages
Thanks for your responses. I'm going to check out GDB. Maybe I'm wrong about IDEs, but I'm just getting into this. Nearly 100% of my experience with coding is PHP, JavaScript, and web oriented technologies. It's kind of exciting to do something really different. -
I've been playing around with C and C++ on my Ubuntu machine. I tried it once on Windows and I didn't have a good experience because I didn't like using the Visual Studio. I like to write code, so really prefer a text editor over an IDE. This weekend I found that it is super easy to write and run C and C++ programs on Ubuntu. GCC was already installed, and after installing G++ I could compile C++ programs easily. I just used my text editor, which is all I really want to use. The only thing I was struggling with, and it could be the reason why I may need an IDE, is debugging. The error messages that GCC and G++ are giving are not very awesome, and sometimes I would compile the program without error, just to find that it gives a "segmentation fault" or other errors that offer no information. So am I forced to learn and use an IDE, or are there debugging tools I should use instead? If you don't use an IDE, what do you use, and how do you debug?
-
I'm a freelancer too. My website has changed many times over the years. I've almost always got phone calls and jobs, except for when my website approached weirdness. I had made a very dark black/neon type theme. I thought it looked cool, but no calls. I think you'd be better off with just a simple but normal template. You'd be more likely to get some jobs with a simple WordPress installation and a premium theme from themeforest. The Enfold theme on themeforest is really slick. The worst part of your website is that it has no text to tell the story. People that go to your website will judge it in about 2 seconds, and then click away to something else if they don't like what they see. Having a couple paragraphs of text about what you do would be beneficial. Also, make sure your phone number is easily seen (large) with no scrolling. Also, double clicking on items is not normal. I had to look at source code to figure out how things worked. Normal site visitors will just be confused and leave.
-
It is good that you want to learn about an authentication script, but what you don't realize is how much work it can take to make it safe for you and your site visitors. I suggest that you learn how to debug your script. For instance, at any given point in your script, you should know what the values are for the variables you are using. One observation: what is the meaning of using setcookie() on line 4? Also, why set two variables with the same value ( $_COOKIE['ID_my_site'] )? Also, $username in your query is not safe. You should be using a prepared statement or somehow sanitizing $username.
-
Really? I've got to ask you, how much PHP experience did you have before you started using frameworks? There are times when a framework is absolutely overkill. There are times when I use a framework, yet still have some standalone scripts that do simple tasks outside the framework.
-
After a while you'll end up using a lot of hosts, and then you'll find one that works well, has good technical support, etc. I tend to prefer smaller hosts because I think you get more for your money. Most of these smaller hosts end up becoming larger over time, and I switch if necessary. That said, I switched to MDD Hosting a few years ago, and am still very satisfied with everything. Technical support is all tickets/emails, but they are always super fast to respond. They are very transparent when it comes to server issues, where I've found a lot of hosts will just give you a lame excuse (if you notice). MDD is worth a try.