Categories
programming

Bash skript za iterativno brisanje

#!/bin/bash
for i in {0..60}
do
    rm -r /home/backup/daily.$i/path/to/bogus\ folder/
done
Categories
interwebs

SEO tips

  1. title tag je bitan zato što će se pojaviti kao naziv vaše stranice prilikom pretrage. Važno je uložiti napor i svakoj stranici koju kreirate dodeliti jedinstven naslov (title) dužine do 70 znakova.
  2. description tag je takođe bitan, to će u rezultatu pretrage pisati odmah ispod naslova. Opet je bitno za svaku stranicu napisati konkretan opis koji se odnosi baš na sadržaj te stranice.
  3. keywords tag nije više presudan ali neće da škodi ako ga ispravno popunite.
  4. header (h) tagovi treba da prate strukturu stranice. Koristiti alt tagove kod slika. Linkovi na sajtu ne treba da budu generički tipa “klikni ovde”.
  5. Struktura URL-ova mora biti jednostavna tipa sajt.com/kategorija/tema što podrazumeva kreiranje jednostavne strukture direktorijuma i dokumenata unutar njih.
  6. Ako posetilac odluči da obriše “tema” iz gornjeg URL-a, trebalo bi da mu se otvori stranica sa kategorijama a ne, recimo, poruka “ovaj dokument ne postoji”.
  7. Prikazati posetiocu breadcrumb kako bi u svakom trenutku znao gde se na sajtu nalazi.
  8. Kod navigacije pre treba koristiti tekstualne linkove umesto slika, javascript-a, padajućih menija, flash-a itd.
  9. Stranica 404 (dokument nije nađen) treba da ima upotrebnu vrednost, na primer, da na sebi ima polje za pretragu, neku sugestiju ili mapu sajta
  10. Za svaki dokument/stranicu koji imate na sajtu potrebno je da postoji jedinstvena URL adresa, u protivnom saobraćaj će se deliti između njih i biće na neki način konkurentne jedna drugoj. Izvršiti i canonical URL check
  11. Vreme učitavanja stranica treba smanjiti na minimum.
  12. Postoji više mapa sajtova koje možete da obezbedite za vaš sajt. Najbitniji su sitemap.xml koji će koristiti botovi prilikom prolaska kroz vaš sajt i mapa sajta koju će koristiti vaši posetioci. Ako želite, možete napraviti i mapu slika kao i mapu stranica optimizovanih za mobilne telefone.
  13. Pomoću datoteke robots.txt možete sprečiti botove da indeksiraju određene delove sajta a pomoću “rel=nofollow” možete sprečiti bota da prati neki od linkova.
  14. Trend pokazuje da sve više ljudi koristi mobilne uređaje kako bi pristupalo sajtovima pa stoga treba razvijati sajtove koji se podjednako dobro vide i na punom HD monitoru i na mobilnom telefonu (responsive dizajn, na primer).

Majstor Kvariš

Categories
interwebs

SEO 2013 & beyond

Knjiga SEO 2013 and beyond na jednostavan i praktičan način opisuje kako je Google nekada rangirao rezultate pretraživanja a kako to radi od 2012. godine, odnosno, od Penguin apdejta. Da sumiram to u par rečenica…

Pre Pingvina, za visok rejting među rezultatima pretrage je bilo potrebno:

  1. pronaći visoko tražene ključne reči za koje je konkurencija slaba
  2. optimizovati stranicu za te ključne reči
  3. generisati masu povratnih linkova koji u naslovu imaju ove ključne reči
  4. uživati u kratkotrajnom skoku popularnosti

Od sredine 2012. godine Google uvodi optimizaciju svog pretraživača a sve u cilju da smanji spam i nekvalitetne tekstove tako da nam je sada potrebno sledeće:

  1. Kvalitetan sadržaj za posetioce a ne sadržaj optimizovan za pretraživače. To podrazumeva da u tekstu “gustina” ključnih reči treba da bude prirodna a ne napumpana (tačka 2 iz vremena pre Pingvina). Dalje, tekst treba da izgleda kao da ga je napisao stručnjak odnosno neko ko zna o čemu priča, stručnjak prirodno u pisanju koristi termine koji se odnose na datu temu (niche vocabulary) što doprinosi relevantnosti teksta i njegovom boljem rangiranju i, jako važno, tekst treba da doda neku vrednost u odnosu na već postojeće tekstove (prvih 10 iz rezultata pretraživanja tzv. serps) na istu temu.
  2. Organizacija sajta u smislu da naziv domena ne utiče više na pozicioniranje (kupivijagru dot com više neće biti prvi na listi rezultata), da sadržaj treba grupisati po tematici ili kategorijama (tzv. silosi) kojima će se pristupati preko menija kako bi se korisnicima olakšala navigacija. Treba koristiti interno povezivanje/linkovanje sadržaja/stranica u okviru teksta kako bi korisnici na klik mogli da saznaju nešto više. Isto tako treba koristiti povezane sadržaje i, na kraju, treba koristiti tagove.
  3. Autoritet – sadržaji moraju da imaju status informacija ili saveta stručnjaka, povratni linkovi treba da dolaze sa kvalitetnih sajtova iz branše, odlazni linkovi takođe treba da vode na kvalitetne sajtove, poželjno je povezati se u društvenu mrežu (FaceBook, Twitter, YouTube…), pisati na tuđim relevantnim blogovima itd.
  4. Šta korisnik treba da dobije? Dobar dizajn, brzinu sajta, zaraznost sadržajem, interaktivnost (pitanja i komentari) i poverenje u informacije sa sajta.

Majstor Kvariš

Categories
organization

Productivity tips 2

The first 15 minutes of your workday sets the tone for the rest of your workday. If you are already too busy at the start of your workday, imagine what the rest of your day might be like when challenges arise and other people start seeking you for help. Here are 14 things productive people do in the first 15 minutes of their workday to help them stay productive for the rest of their day.

Productive people know the importance of reporting to work early. Instead of rushing to work anxiously and hoping to be on time, they leave their house early and stroll into the office calmly. They set a relaxing tone right from the start of their workday and give themselves an extra 15 minutes to be ready for work.

Similar to a surgeon performing an operation and a chef working in the kitchen, productive people make sure their tools are in proper position before they begin their work. Every minute counts in the operating theater and kitchen, so too in your workspace! Productive people keep their workspace organized so that they don’t have to spend unnecessary time looking for what they need.

It’s good to review what you have done previously, especially if you’ve just returned from the weekend or holidays. Productive people warms themselves up for work by reminding themselves where they left off previously. Instead of jumping straight into a task, they review past achievement to give themselves some direction on what to do next and a sense of accomplishment.

Productive people have a to-do list. They review their to-do list at the start of their workday so that they can strategize and plan ahead. They remind themselves of important deadlines and meetings so that they can prioritize and schedule their work accordingly.

Productive people know they will be overwhelmed if they plan too much for themselves. To stay focused at work and prevent themselves from multitasking they identify no more than 3 important tasks for the day. Leo Babauta, founder of the productivity blog Zen Habits, also sets himself 3 most important tasks (MITs) each morning to move himself forward.

Productive people gain clarity on what they want to achieve each day by asking themselves good questions. They identify problems clearly and assess if these problems need to be solved. They don’t waste time during their day solving unimportant issues. Asking good questions also motivates during the day. For example, Ron Friedman, an expert on human motivation, suggests to ask this question at the beginning of your workday: “The day is over and I am leaving the office with a tremendous sense of accomplishment. What have I achieved? ”

Productive people like Tumblr founder David Karp don’t check or read their emails in the first 15 minutes of their workday. They know they will get distracted easily. If they anticipate important emails from their superiors and customers, they will scan their inbox for these emails and schedule replies accordingly. They don’t read emails in chronological order and reply to emails immediately.

Productive people know they get the most work done in the morning, so they prioritize what is important and plan their work first. They put their mobile phone on silent and do not have their schedule dictated by incoming messages and notifications.

Similar to athletes who use visualization techniques for training and competition, productive people run through positive images of success and achievement in their mind. They mentally rehearse and practice what they have to do for the day and program their subconscious mind. When it’s time for them to actually perform the task, they find it much easier.

After visualizing the future, productive people take a moment to be present. They know they may get too busy during the day so they take a break even before they start their work. Breathing deeply provides oxygen to your brain. It makes you think clearer and allow you to be calmer. Successful people like Oprah Winfrey and Arianna Huffington take time to mediate in the morning too.

Productive people know they have to sit in front of the computer all day. They know that being inactive for too long would bring them health problems in the long run. To combat this they do some light stretching in the first 15 minutes of the workday and schedule time to stretch throughout the day.

Productive people don’t talk to their colleagues about work issues first thing in the morning. They respect other people’s time and they know their colleagues need time to get ready for work. Unless you want others to find you early in the morning, don’t go into your office and ask others for favors straightaway.

Productive people know the importance of fulfilling their own needs before helping others. They determine their own priorities first and slot in other people’s requests later. They don’t try to be supermen or superwomen and help everyone in need. They respect their 15 minute routine in the morning and will politely reject or delay requests if they are approached by others.

Productive people remind themselves each morning how blessed they are to have a job and be of value to others. They see challenges as opportunities to grow and stretch themselves. They look forward to work each day. When you feel good about your work, it removes any negative feeling or procrastination you may have that prevents you from being productive.

Lifehack

Categories
organization

Productivity tips 1

  1. Keep your desk clean
  2. Silence your phone
  3. Mute your email during work hours
  4. Write distractions down for later
  5. Take regular breaks
  6. Save non-important articles for later
  7. Block notifications
  8. Don’t always just work at the office
  9. Sit by a window
  10. Go for walks
  11. Get the right amount of sleep, healthy food and exercise
  12. Create a comfortable temperature for you to work in
  13. Meditate
  14. Buy plants
  15. Listen to music you enjoy
  16. Put up pictures of things that make you happy, whether it be family members, pets or art
  17. Keep meetings short and sweet
  18. Delegate
  19. Track exactly where your time goes
  20. Simplify your inbox
  21. Quit Facebook during work hours
  22. Automate tedious tasks
  23. Batch similar tasks
  24. Try a dictation app
  25. Cut out bad habits
  26. Quit multitasking
  27. Prioritize your tasks everyday
  28. Don’t check your email until you’ve worked for 2 hours
  29. Write your 3 most important tasks on a Post It
  30. Do your most important task first
  31. Smile and be happy
  32. Write tomorrows to-do list tonight
  33. Try to do your most creative tasks first
  34. Break big tasks into bitesize pieces
  35. “Eat the Frog”
  36. If it takes less than 2 minutes, do it now
  37. Work out when you work best
  38. Make progress visible and celebrate small wins
  39. “Don’t break the chain”
  40. Bribe yourself with a reward

UltraLinx

Categories
organization

Get organized

Get yourself organized at the start and end of a day. As you start your work day, write down your three Most Important Tasks (MITs). Write down a handful of other things you’d like to do today as well. Clear your desk, get things in order. At the end of each day, tidy things up, check off your list, maybe even get things ready for tomorrow.

When you get up from your desk, put one thing away. Whenever you get up for a glass of water, to go to the bathroom, to take a break, pick up something off your desk and put it away. If your desk is clear, look for something nearby.

When you’re done eating, wash your bowl. This is self-explanatory. Mindfully wash your dishes instead of leaving them in the sink. If there are other dishes in the sink, wash a few of them too.
Wipe down the sink when you use it. Whenever you wash your hands or brush your teeth in the bathroom, wipe down the sink so it’s clean. Do the same in the kitchen sink. Clear away a few things around the sink too if you can.

When you walk through a room, find one thing to put away. If you’re going from your bedroom to the living room, find one thing during that trip to put away. You don’t have to get stuck in putting everything away, just one thing.

When you take off a piece of clothing, put it away. When you shower or change clothes, instead of leaving them on the floor or on a piece of furniture, put the clothes away or in a hamper. Look for a few other clothes to put away too if there are more lying around.

Keep flat surfaces clear. Your tables, counters, desks, floors—keep them clear. If there’s a ton of clutter there now, see the rule below about decluttering on Saturdays. But if it’s doable, just start clearing whatever is on the floor (except furniture and the like). When you walk by the kitchen counter, look for things other than oft-used appliances to put away.

At the end of the work day, file stuff. If you still use papers, file them at the end of the day. If you are all digital, clear your computer desktop and put files where they belong.

Deal with an email instead of putting it off. When you open an email, give it the space to deal with it immediately. Read it, reply, take action, or archive it. Or put it on your to-do list for later if it’s a big task. Don’t just constantly open emails without handling them.

Work to only having three emails in your inbox. Slowly clear away the hundreds or thousands of emails in your inbox. Archive or delete them, put a handful in a to-do folder, file others into informational folders, unsubscribe from newsletters.

Put non-essential items you want to buy on a 30-day list. Create a 30-day list, and whenever you want to buy something that’s not absolutely essential (other than groceries, cleaning supplies, toiletries), put it on the list with the date you added it. Then don’t allow yourself to buy anything until it’s been on the list for 30 days. At the end of the 30 days, see if you still want it before buying.

Put your clothes in a different closet or box, and only take out what you need. Move all your clothes to a closet in an unused room if you have one, or put them in a box or two. Only remove the clothes you really need to wear. After a month of doing this, you’ll see what clothes you can consider donating.

Declutter on Saturdays. Every Saturday morning, spend an hour or two (or half a day) decluttering one area.

One in, two out. When you bring something new in your life (buy something online, get a gift), get rid of two other similar things. For example, if you buy a pair of shoes, donate two other pairs. In this way, you’ll 1) think more about each thing you buy, and 2) slowly have fewer and fewer possessions. Eventually you’ll want to switch to a “one in, one out” rule when you think your possessions are at a good level.

Limit how many things you have. Consider limiting yourself to 30 pieces of clothing, or 30 books, or something like that. Get rid of everything else, don’t allow yourself to go beyond the limit. The individual limit you set is up to you, whatever feels slightly uncomfortable is good.

At the end of each month, clear out computer clutter. Self-explanatory. Back things up!

Every three months, purge. Also self-explanatory. Spend a weekend purging all your unneeded belongings.

Zen Habits

Categories
android

Android tasks

The fact that you can see an application’s process “running” does not mean the application is running or doing anything. It may simply be there because Android needed it at some point, and has decided that it would be best to keep it around in case it needs it again. Likewise, you may leave an application for a little bit and return to it from where you left off, and during that time Android may have needed to get rid of the process for other things.

A key to how Android handles applications in this way is that processes don’t shut down cleanly. When the user leaves an application, its process is kept around in the background, allowing it to continue working (for example downloading web pages) if needed, and come immediately to the foreground if the user returns to it. If a device never runs out of memory, then Android will keep all of these processes around, truly leaving all applications “running” all of the time.

http://lifehacker.com/5650894/android-task-killers-explained-what-they-do-and-why-you-shouldnt-use-them
http://lifehacker.com/smartphone-battery-myths-explained-1735327089

Categories
web server

Apache i projekat u lokalnom direktorijumu

1. dodati sebe u http grupu

# gpasswd -a username http

2. izlogovati se pa ponovo ulogovati 🙂

3. napravi se simbolički link do projekta:

# ln -sT /home/username/projects/projekat/public_html /srv/http/projekat

4. grupa za /home/username se podesi na http, doda se x permisija za http grupu

# ls -l /home/
 drwx--x--- 112 username http 4096 Jul 7 22:26 username

5. prođe se kroz čitavo stablo /home/username/projects/projekat/public_html kako bi se proverilo da li Apache može da pročita sve fajlove

6. dodati w dozvolu nad fajlovima i direktorijumima u koje Apache treba da može piše

7. setgid?

https://askubuntu.com/questions/46331/how-to-avoid-using-sudo-when-working-in-var-www/46371#46371

d=/home/username/projects/projekat/public_html; while test $d != '/'; do ls -ld $d; d=`dirname $d`; done
Categories
web design

Web design tips

FONTS

Recommendation #1: Use one font per project

Recommendation #2: Have a small number of “go-to” fonts

Fonts can make a big difference in what your project conveys, but you can get most of the effect you’re looking for by choosing your ONE font from just a few different fonts. Restrict your choices to just a few different fonts. You can consult the “all of the fonts you’ll ever need” cheat sheet I sent you when you enrolled in the course, or here’s a few other recommendations:

  • Georgia for a sophisticated serif
  • Helvetica for a clean and neutral design
  • Lato for a friendly and “natural” look
  • Raleway for a more modern geometric look

Recommendation #3: Start worrying about other things

Getting good at anything is all about breaking down the overwhelm, and reducing the factors. Once you only have a few factors you’re working with, you reduce your anxiety, and can start to make sense of the choices you’re making. Once you’ve decided that you’re only using one font, and you start using that font, you’ll start to notice things you didn’t notice before. You’ll have to start getting creative with how you use your typography. You’ll experiment with sizes (next lesson’s topic), you might try a little all-caps here and there (for very short pieces of text), and you’ll experiment with bolds and italics.

3:4 TYPOGRAPHIC SCALE

Font sizes based upon 3:4 scale: 5 7 9 12 16 21 28 37 50 67 89 111 148

COLORS

One color and couple of shades of gray.

12-COLUMN DESIGN

Reduce it to 3, 4 or 6 columns

NERD-EYE BLINDNESS

“You’ve got to start with the customer experience and work back toward technology, not the other way around.” – Steve Jobs

DON’T DIVIDE MY ATTENTION, FOCUS IT

Categories
games

How to be good in FPS

  • cut your lines of sight
  • make yourself a smaller target
  • don’t second guess
  • don’t move forward when shooting
  • shots connect with the middle of the screen
  • aim for the upper chest area
  • move along the outside
  • bump up the look speed
  • wired network
  • be comfortable
  • don’t get angry; relax
  • use guns you like