Sign in or Join FriendFeed
FriendFeed is the easiest way to share online. Learn more »

Andrei Vladescu-Olt › Comments

Andrei Vladescu-Olt
reddit is offline in protest of PROTECT IP and SOPA - http://www.reddit.com/
"submitted by reddit to blog." - Andrei Vladescu-Olt
Andrei Vladescu-Olt
andreivolt on What's been your luckiest escape? - http://www.reddit.com/r...
"On a misty morning, I was a bit late to catch a train that would take me to uni, and probably not very well awake. The place I lived at had no barriers along the railways, so you were supposed to cross only when the lights were green using a dedicated path. Closing in on the train station, I saw trough the mist that the red light had just been switched on, and, foolishly proceeded to run towards the train station (I was about 30 meters / 100 feet way). I got to the rails, continued running to the other side where the train platform was, heard a loud train horn, saw the train nearing at full speed in the corner of my eye, stumbled on the previous-to-last rail, fell with my hands on the platform, raised myself as quickly as I could. By the time I got up and turned my head around, the train was passing by me and everybody on the platform was looking at me in shock. I had bloody hands from the stumbling / lifting and the shock hit me that I was about 1 or 2 seconds away from being killed." - Andrei Vladescu-Olt
Andrei Vladescu-Olt
$config['base_url'] = 'http' . ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 's' : '') .'://'.$_SERVER['HTTP_HOST'].str_replace('//','/',dirname($_SERVER['SCRIPT_NAME']).'/'); - Andrei Vladescu-Olt
Andrei Vladescu-Olt
pr0digy.com » CodeIgniter - loading external libraries - http://pr0digy.com/codeign...
function __autoload($class) { //prevent CI and Pear classes from being loaded. if(!strstr($class, 'CI') && !stristr($class, 'PEAR')){ require_once(PATH_TO_LIBRARIES."$class.php"); } } - Andrei Vladescu-Olt
Andrei Vladescu-Olt
Eavesdrop on your system | commandlinefu.com - http://www.commandlinefu.com/command...
diff <(lsof -p 1234) <(sleep 10; lsof -p 1234) This command takes a snapshot of the open files for a PID 1234 then waits 10 seconds and takes another snapshot of the same PID, it then displays the difference between each snapshot to give you an insight into what the application is doing. - Andrei Vladescu-Olt
Andrei Vladescu-Olt
Copy a MySQL Database to a new Server via SSH with one command | commandlinefu.com - http://www.commandlinefu.com/command...
mysqldump --add-drop-table --extended-insert --force --log-error=error.log -uUSER -pPASS OLD_DB_NAME | ssh -C user@newhost "mysql -uUSER -pPASS NEW_DB_NAME" - Andrei Vladescu-Olt
Andrei Vladescu-Olt
Iptables / Allow all traffic to from private IP? - Linux Forums - http://www.linuxforums.org/forum...
iptables -A INPUT -i <iface> -s 192.168.2.6 -j ACCEPT - Andrei Vladescu-Olt
Andrei Vladescu-Olt
Create custom keybindings in vim | Linux and Open Source | TechRepublic.com - http://blogs.techrepublic.com.com/opensou...
" map CTRL-E to end-of-line (insert mode) imap <C-e> <esc>$i<right> " map CTRL-A to beginning-of-line (insert mode) imap <C-a> <esc>0i - Andrei Vladescu-Olt
Andrei Vladescu-Olt
Matt's Stuff: Creating persistent SSH tunnels in Windows using autossh - http://www.matthanger.net/2008...
cygrunsrv -I AutoSSH -p /usr/bin/autossh -a "-M 20000 -L localaddress:port:serveraddress:port user@ssh.host.name" -e AUTOSSH_NTSERVICE=yes # Tweak Windows service settings. 1. Open the Services management console (Administrative Tools -> Services). 2. Edit the properties of the AutoSSH service. 3. In the "Log On" tab, select the "This account" radio button and set the service to run as your current user. 4. Start the service. - Andrei Vladescu-Olt
Andrei Vladescu-Olt
How to remove unneeded language packs? - Ubuntu Forums - http://ubuntuforums.org/showthr...
sudo apt-get install localepurge - Andrei Vladescu-Olt
Andrei Vladescu-Olt
Fix backspace/delete when ssh'ing into Linux machines - Mac OS X Hints - http://www.macosxhints.com/article...
This is a very common and very annoying problem. Your remote host expects some character to be used as "erase", a terminal program you use sending some character as "erase". If they differ - sometimes you getting ^? or ^H when pressing backspace. So to fix this you just need bring both parts in sync. 1. When connected type "stty -a" and in output find what is expected to be an erase code (erase = ^? f.e.) 2. Type CTRL-v and press your backspace. You'll see what code is sent as "erase". ^H f.e. 3. Type "stty erase ^H" and this is it. Now they'll understand each other. - Andrei Vladescu-Olt
Andrei Vladescu-Olt
How To Configure Vsftpd Server With Passive Mode Port Range | Wowtutorial - http://www.wowtutorial.org/tutoria...
pasv_enable=YES - Andrei Vladescu-Olt
Andrei Vladescu-Olt
How To Get Directory Path Only Without File Name In PHP - http://www.wallpaperama.com/forums...
function GetFileDir($php_self){ $filename = explode("/", $php_self); // THIS WILL BREAK DOWN THE PATH INTO AN ARRAY for( $i = 0; $i < (count($filename) - 1); ++$i ) { $filename2 .= $filename[$i].'/'; } return $filename2; } echo GetFileDir($_SERVER['PHP_SELF']); - Andrei Vladescu-Olt
Andrei Vladescu-Olt
Slicehost Articles: MySQL - exporting and importing databases - http://articles.slicehost.com/2008...
Export In this example, we will export the 'mytestdb' database into a file called 'mytestdb.sql': mysqldump -u root -p mytestdb > mytestdb.sql Er, that's it. Once done, the sql file can be copied to a new Slice or server ready to be imported into MySQL. Import Importing the data is just as easy but involves two steps. The first step is to create a blank database ready to receive the data (remember this is on the Slice or server to which the database is going to imported): mysqladmin -u root -p create mytestdb2 Once done, all that is left is to actually import the data: mysql -u root -p mytestdb2 < mytestdb.sql - Andrei Vladescu-Olt
Andrei Vladescu-Olt
Ubuntu-9.04 - fail2ban configuration problems - HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials - http://www.howtoforge.com/forums...
Solution for Ubuntu 9.04 #apt-get install python2.5 Change the python version there execute the fail2ban-server script. /usr/bin/fail2ban-server (edit) Change the first line from: #!/usr/bin/python --> to #!/usr/bin/python2.5 After that restart fail2ban # /etc/init.d/fail2ban restart - Andrei Vladescu-Olt
Andrei Vladescu-Olt
Error opening CA private key ./demoCA/private/cakey.pem « Hone Watson Bookmarks - http://bookmarks.honewatson.com/2008...
updatedb locate CA.sh locate CA.pl …./CA.sh –newca - Andrei Vladescu-Olt
Andrei Vladescu-Olt
So, check that all your logs are synchronized: all logs files (auth.log, syslog,..) must use the same time reference (if your server is not very busy, there will probably be an important difference between the output of [1]date command and the last event logged in syslog. You can force to generate a log in syslog using the logger command and check then with the output of date command) # date Wed Nov 28 13:49:02 CET 2007 # tail -2 /var/log/auth.log Nov 28 13:39:12 <SERVERNAME> sudo: pam_unix(sudo:session): session opened for user roo t by <user>(uid=0) Nov 28 13:39:12 <SERVERNAME> sudo: pam_unix(sudo:session): session closed for user roo t - Andrei Vladescu-Olt
Andrei Vladescu-Olt
scie.nti.st » Colors in git - http://scie.nti.st/2007...
Put the following in your ".git/config" file: [color] branch = auto diff = auto status = auto [color "branch"] current = yellow reverse local = yellow remote = green [color "diff"] meta = yellow bold frag = magenta bold old = red bold new = green bold [color "status"] added = yellow changed = green untracked = cyan - Andrei Vladescu-Olt
Andrei Vladescu-Olt
[SOLVED] Zimbra.log has a different time zone than ubuntu mail server - Zimbra :: Forums - http://www.zimbra.com/forums...
I solved my "6 hours off" problem with system log /var/log/messages when I restarted /etc/init.d/sysklogd - Andrei Vladescu-Olt
Andrei Vladescu-Olt
Find out your router’s external IP address using the Linux command line | Tips4Linux.com - http://tips4linux.com/find-ou...
wget -O - -q icanhazip.com - Andrei Vladescu-Olt
Andrei Vladescu-Olt
How-to use PHPMailer for SMTP and GMail | Web Development Blog - http://www.web-development-blog.com/archive...
define('GUSER', 'you@gmail.com'); // Gmail username define('GPWD', 'password'); // Gmail password function smtpmailer($to, $from, $from_name, $subject, $body) { global $error; $mail = new PHPMailer(); // create a new object $mail->IsSMTP(); // enable SMTP $mail->SMTPDebug = 0; // debugging: 1 = errors and messages, 2 = messages only $mail->SMTPAuth = true; // authentication enabled $mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for Gmail $mail->Host = 'smtp.gmail.com'; $mail->Port = 465; $mail->Username = GUSER; $mail->Password = GPWD; $mail->SetFrom($from, $from_name); $mail->Subject = $subject; $mail->Body = $body; $mail->AddAddress($to); if(!$mail->Send()) { $error = 'Mail error: '.$mail->ErrorInfo; return false; } else { $error = 'Message sent!'; return true; } } smtpmailer('to@mail.com', '', 'from@mail.com', 'yourName', 'test mail message', 'Hello World!'); - Andrei Vladescu-Olt
Andrei Vladescu-Olt
How do you check if a selector exists in jQuery? - Stack Overflow - http://stackoverflow.com/questio...
jQuery.fn.exists = function(){return jQuery(this).length>0;} Then in your code you can use if ($(selector).exists()) { // Do something } - Andrei Vladescu-Olt
Andrei Vladescu-Olt
Can I turn on USB mass storage through the recovery console? - Android Forums - http://androidcommunity.com/forums...
adb shell echo /dev/block/mmcblk0 > /sys/devices/platform/usb_mass_storage/lun0/file - Andrei Vladescu-Olt
Andrei Vladescu-Olt
The command ls -p will produce a directory listing in which any directories are marked with a trailing slash. - Andrei Vladescu-Olt
Andrei Vladescu-Olt
With --color=auto, grep will highlight the matching portion of the line in color when it outputs to a terminal, while avoiding the use of any potentially-harmful terminal control sequences when standard output goes somewhere else (like a file or pipe). If you like the colorful grep, you can simply export GREP_OPTIONS='--color=auto' in your shell startup script. grep's default highlight uses a red color. You can change this color by setting the GREP_COLOR environment variable to a different escape sequence fragment. I use export GREP_COLOR='1;32', which produces a bright green. - Andrei Vladescu-Olt
Andrei Vladescu-Olt
How do you indent your code? « Terminally Incoherent - http://www.terminally-incoherent.com/blog...
if(a==b) { // do something foo(); } else { // do something else bar(); } - Andrei Vladescu-Olt
Andrei Vladescu-Olt
Text Rotation with CSS - Snook.ca - http://snook.ca/archive...
-webkit-transform: rotate(-90deg); moz-transform: rotate(-90deg); filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); The rotation property of the BasicImage filter can accept one of four values: 0, 1, 2, or 3 which will rotate the element 0, 90, 180 or 270 degress respectively. - Andrei Vladescu-Olt
Andrei Vladescu-Olt
How To Create A Custom Page Template In WordPress | The Expand2Web Blog - http://www.expand2web.com/blog...
<?php /* Template Name: Cover Page */ ?> - Andrei Vladescu-Olt
Andrei Vladescu-Olt
jQuery Inline Form Labels | Trevor Davis - http://trevordavis.net/blog...
$('input[title]').each(function() { if($(this).val() === '') { $(this).val($(this).attr('title')); } $(this).focus(function() { if($(this).val() === $(this).attr('title')) { $(this).val('').addClass('focused'); } }); $(this).blur(function() { if($(this).val() === '') { $(this).val($(this).attr('title')).removeClass('focused'); } }); }); - Andrei Vladescu-Olt
Andrei Vladescu-Olt
How to Get Most Commented Posts with Thumbnail # WordPress Tricks & Tips - http://wptricks.net/how-to-...
<?php $popular = new WP_Query('orderby=comment_count&posts_per_page=5'); ?> <?php while ($popular->have_posts()) : $popular->the_post(); ?> <?php $justanimage = get_post_meta($post->ID, 'thumbnail', true); if ($justanimage) { ?> <img src="<?php echo get_post_meta($post->ID, "Image", true); ?>" alt="<?php the_title(); ?>" /> <?php } else { ?> <img src="http://an-alternative-image.jpg" alt="" /> <?php } ?> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <?php endwhile; ?> - Andrei Vladescu-Olt
Other ways to read this feed:Feed readerFacebook