Search Results

Search found 628 results on 26 pages for 'vi'.

Page 20/26 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • How do i enable syntax highlighting and syntax indentation in mysgit vim?

    - by gath
    Am using mysgit for windows, but mysgit vi editor is unable to do syntax highlighting and indentation for my source code (html/python/css .... files) I managed to copy the syntax folder from my original GVIM7.2 installation to Git Vim72 installation folder, now i see like syntax highlighting is active. What am unable to do is indentation. I have tried to copy the ftplugin folder from my GVim7.2 installation to Git Vim72 folder but still no indentation. I have tried to place filetype plugin indent on setting on the vimrc file, but still nothing is working? Any help on how to enable syntax indentation? Gath

    Read the article

  • how do I detect OS X in my .vimrc file, so certain configurations will only apply to OS X?

    - by Brandon
    I use my .vimrc file on my laptop (OS X) and several servers (Solaris & Linux), and could hypothetically someday use it on a Windows box. I know how to detect unix generally, and windows, but how do I detect OS X? (And for that matter, is there a way to distinguish between Linux and Solaris, etc. And is there a list somewhere of all the strings that 'has' can take? My Google-fu turned up nothing.) For instance, I'd use something like this: if has("mac") " open a file in TextMate from vi: " nmap mate :w<CR>:!mate %<CR> elseif has("unix") " do stuff under linux and " elseif has("win32") " do stuff under windows " endif But clearly "mac" is not the right string, nor are any of the others I tried.

    Read the article

  • Unable to update the snapshot view in clearcase on linux

    - by crystal
    Hi I am trying to create a new snapshot view on my machine and i am using the following procedure: creating the view using ct mkview -snapshot -tag testview -vws /home/store/testview.vws /home/view/testview here the view gets created but fails to register which i register using the ct update on this /home/view/testview location tried to change the configspec using ct edcs & but got error "cleartool: Error: Cannot get view info for current view: not a ClearCase object." explicitly modifying the config_spec using vi editor, and the updating the view ends up creating a log...but no files are copied :( Can someone please direct me as to where i am going wrong?

    Read the article

  • how to combine these queries

    - by mmcgrail
    and get meaningful results. Currently I am running these three queries: SELECT t.type,t.id,s.title FROM db1.tags t INNER JOIN db1.st s ON s.id=t.id WHERE id LIKE '%%' AND t.tag='foo' AND t.type='s' ORDER BY tag desc LIMIT 0, 19 SELECT t.type,t.id,v.title FROM db1.tags t INNER JOIN db1.vi v ON v.id=t.id WHERE id LIKE '%%' AND t.tag='foo' AND t.type='v' ORDER BY tag desc LIMIT 0, 19 SELECT t.type,t.id,i.ca AS title FROM db1.tags t INNER JOIN db2.tablename i ON i.id=t.id WHERE id LIKE '%%' AND t.tag='foo' AND t.type='i' ORDER BY tag desc LIMIT 0, 19 then trying to combine the data results but what I would really prefer is if I could combine them into a single query. Any thoughts?

    Read the article

  • Youtube python: get thumbnail

    - by dkgirl
    Is there a simple way to get the default thumbnail from a youtube entry object gdata.youtube.YouTubeVideoEntry? I tried entry.media.thumbnail, but that gives me four thumbnail objects. Can I always trust that there are four? Can I know which is the default thumbnail that would also appears on the youtube search page? And how would I get that one? Or do I have to alter one of the other ones? When I know the video_id I use: http://i4.ytimg.com/vi/{{video_id}}/default.jpg so, it would also be helpful to get the video_id. Do I really have to parse one of the url's to get at the video_id ? It seems strange that they don't provide this information directly.

    Read the article

  • ghc can't find my cabal installed packages

    - by nont
    I've installed ghc 6.12.3, and then the Haskell Platform. I'm trying to compile a test program: $ ghc test.hs test.hs:3:0: Failed to load interface for `Bindings': Use -v to see a list of the files searched for. so, naturally, I do cabal install Bindings Which works fine, and places the package in ~/.cabal/lib/bindings-0.1.2 The problem is, that when I go to compile again with ghc, it still doesn't find the package I've installed with cabal. compiling in verbose mode gives: ghc -v test.hs Using binary package database: /home/ludflu/ghc/lib/ghc-6.12.3/package.conf.d/package.cache Using binary package database: /home/ludflu/.ghc/x86_64-linux 6.12.3/package.conf.d/package.cache As suggested by another stackoverflow user, I tried: ghc-pkg describe rts > rts.pkg vi rts.pkg # add the /home/ludflu/.cabal/lib to `library-dirs` field ghc-pkg update rts.pkg But to no avail. How to I add the .cabal to the list of package directories to search? Thank you!

    Read the article

  • Installing XAMPP in Amazon EC2

    - by Woho87
    Hi! Can someone explain to me(not a rocket scientist) all the steps for installing XAMPP for a EC2 instance running Linux? And yes I have look the entire web and found nothing, except this "Deploying a lamp stack" and this "Starting Amazon EC2 with Mac OS X". I found the latter one more useful, but as a said I'm not a rocket scientist. I got stuck in to the latter link where I should edit the file .bash_profile with a text editor. I tried the "vi" in SSH, but why can't I open it on textEditor included in all Macs? Is there any easier way to setting up a XAMPP server for a linux server in EC2?

    Read the article

  • Is it worth investing time in learning to use emacs?

    - by Andrew
    Right up front: I do not want to start a religious war. I've used vi for as long as I can remember, and the few times I've tried to pick up emacs I've been so lost so quickly I've given up. Lots of people find emacs very powerful, however. Its programmability is somewhat legendary. I'm primarily doing Solaris+Java development, and I'd like to ask a simple question: will my productivity increase if I invest time in getting my head around emacs? Is the functionality that it offers over vim going to be paid back in productivity increases in a reasonable timeframe? Repeat: I don't want a "my editor is better than yours". I just want a yes or no answer as to whether it's worth investing the time or not. Will my productivity really increase?

    Read the article

  • VIM Disable Automatic Newline At End Of File

    - by Boushley
    So I work in a PHP shop, and we all use different editors, and we all have to work on windows. I use vim, and everyone in the shop keeps complaining that whenever I edit a file there is a newline at the bottom. I've searched around and found that this is a documented behavior of vi & vim... but I was wondering if there was some way to disable this feature. (It wouldbe best if I could disable it for specific file extensions). If anyone knows about this, that would be great!

    Read the article

  • Dealing with Windows line-endings in Python

    - by Adam Nelson
    I've got a 700MB XML file coming from a Windows provider. As one might expect, the line endings are '\r\n' (or ^M in vi). What is the most efficient way to deal with this situation aside from getting the supplier to send over '\n' :-) Use os.linesep Use rstrip() (requiring opening the file ... which seems crazy) Using Universal newline support is not standard on my Mac Snow Leopard - so isn't an option. I'm open to anything that requires Python 2.6+ but it needs to work on Snow Leopard and Ubuntu 9.10 with minimal external requirements. I don't mind a small performance penalty but I am looking for the standard best way to deal with this.

    Read the article

  • How to handle inputs in a C shell program during exec

    - by hits_lucky
    I am currently writing my own shell program. This simple shell can just execute commands. When executing commands like vi or calc which require input from the terminal , the command is getting executed and is waiting for the input from the user. But I am unable to give any input on the screen. How should the input be handled during the fork and exec. Here is the piece of code which is executing commands: if((pid = fork()) < 0) { perror("Fork failed"); exit(errno); } if(pid == 0) { // Child process if(execvp(arguments[0], arguments) == -1) { child_status = errno; switch(child_status) { case ENOENT: printf(" command not found \n"); break; } exit(errno); } } else { // parent process int wait_stat; if(waitpid(pid , &wait_stat, WNOHANG) == -1) { printf(" waitpid failed \n"); return; } } } ~ Thanks,

    Read the article

  • How to replace the char '[' etc with '\[' using "sed" in a file ?

    - by Abhijeet
    I have a file say "file.txt" with following contents: Capsule arr**[**0**]** in state A rate_ul/dl=**(**2000000/7000000**)** Capsule RBx**[**0**]** in state ... ... using sed operator how can i replace all occurences of '[' with '[', '(' with '(', ']' with ']' and so on. Capsule arr**\[**0**\]** in state A rate_ul/dl=**\(**2000000/7000000**\)** Capsule RBx**\[**0**\]** in state ... ... Using the substitue operator in "gvim" I am able to achieve the same result. ie. if i use ":1,$ s/\[/\\[/g" in the vi editor in command mode I see all the '[' chars replaced with '['. However if I try to use the same substitue command in a shell script using a sed command, i am not able to achieve the same result. ie If i use the following command in a shell script I am not able to achieve the desired result: sed "s/\[/\\[/g" $temp_file2 > $temp_file1 where $temp_file2 conatins the lines with '[' characters and $temp_file1 should contain the replaced '\[' chars

    Read the article

  • Comma separated values in a database field

    - by John Doe
    I have a products table. Each row in that table corresponds to a single product and it's identified by a unique Id. Now each product can have multiple "codes" associated with that product. For example: Id | Code ---------------------- 0001 | IN,ON,ME,OH 0002 | ON,VI,AC,ZO 0003 | QA,PS,OO,ME What I'm trying to do is create a stored procedure so that I can pass in a codes like "ON,ME" and have it return every product that contains the "ON" or "ME" code. Since the codes are comma separated, I don't know how I can split those and search them. Is this possible using only TSQL? Edit: It's a mission critical table. I don't have the authority to change it.

    Read the article

  • Any tips on switching from bash to zsh if often using shell inside of emacs?

    - by justingordon
    Related to this question: Advantages and disadvantages between zsh and emacs' (e)shell, I've read some great things about zsh, when using M-x shell, my familiar emacs shell seemed like it would need some customizations. I also use evil-mode in shell mode, so that means I use vi keystrokes for shell editing. Took a little while to get accustomed to this, but I really like it. Any advice or tips on going from bash to zsh if one uses emacs? Or better off adding the file completion mentioned in this question: Worth switching to zsh for casual use?.

    Read the article

  • The Diabolical Developer: What You Need to Do to Become Awesome

    - by Tori Wieldt
    Wearing sunglasses and quite possibly hungover, Martijn Verburg's evil persona provided key tips on how to be a Diabolical Developer. His presentation at TheServerSide Java Symposium was heavy on the sarcasm and provided lots of laughter. Martijn insisted that developers take their power back and get rid of all the "modern fluff" that distract developers.He provided several key tips to become a Diabolical Developer:*Learn only from yourself. Don't read blogs or books, and don't attend conferences. If you must go on forums, only do it display your superiority, answer as obscurely as possible.*Work aloneBest coding happens when you alone in your room, lock yourself in for days. Make sure you have a gaming machine in with you.*Keep information to yourselfKnowledge is power. Think job security. Never provide documentation. *Make sure only you can read your code.Don't put comments in your code. Name your variables A,B,C....A1,B1, etc.If someone insists you format your in a standard way, change a small section and revert it back as soon as they walk away from your screen. *Stick to what you knowStay on Java 1.3. Don't bother learning abstractions. Write your application in a single file. Stuff as much code into one class as possible, a 30,000-line class is fine. Makes it easier for you to read and maintain.*Use Real ToolsNo "fancy-pancy" IDEs. Real developers only use vi.*Ignore FadsThe cloud is massively overhyped. Mobile is a big fad for young kids.The big, clunky desktop computer (with a real keyboard) will return.Learn new stuff only to pad your resume. Ajax is great for that. *Skip TestingTest-driven development is a complete waste of time. They sent men to the moon without unit tests.Just write your code properly in the first place and you don't need tests.*Compiled = Ship ItUser acceptance testing is an absolute waste of time. *Use a Single ThreadDon't use multithreading. All you need to do is throw more hardware at the problem.*Don't waste time on SEO.If you've written the contract correctly, you are paid for writing code, not attracting users.You don't want a lot of users, they only report problems. *Avoid meetingsFake being sick to avoid meetings. If you are forced into a meeting, play corporate bingo.Once you stand up and shout "bingo" you will kicked out of the meeting. Job done.Follow these tips and you'll be well on your way to being a Diabolical Developer!

    Read the article

  • Invitation til Oracle Open Experience DK11

    - by user13847369
    Kære Partnere, Vi afholder sammen med Arrow et større kundearrangement den 7. December ved navnet "Oracle Open Experience DK11". I kan se agendaen for dagen her: V. Torben Markussen, Sales director/Middleware director Nordics, Oracle Fornem stemningen fra årets OpenWorld og få præsenteret de største og mest relevante nyheder. Hør hvordan I drager konkret fordel af Oracle-nyheder som Oracle Cloud, storageløsningen Pillar Axiom og de unikke nye muligheder med Fusion Applications. V. Hans Bøge, IT-arkitekt, Oracle Hans Bøge fortæller om hvordan I optimerer jeres licensløsning, og letter administrationen af jeres database. En server fødes med adskillige cores - alle med licensomkostninger. Hvorfor ikke nøjes med at aktivere det antal der matcher jeres behov? Hør hvordan I får en løsning, der kan opgraderes hen ad vejen som behovene opstår. V. Kim Estrup, Produktchef 11G , Oracle Brugerdefinerede implementeringer gør jeres systemer unikke, hvilket kun øger komplek og administration. Kim Estrup vil fortælle alt om, hvordan I letter forvaltningen af jeres traditionelle data-centre, samt etablerer lynhurtig adgang til skyen. Få indføring i en omfattende løsning, der skærer gennem kompleksitet, øger service-kvalitet og minimerer administrations- omkostninger. V. Steen Schmidt, IT-arkitekt, Oracle Hør hvordan de nyeste teknologier indenfor virtualisering og server-management, kan forsimple jeres IT-processer og reducere omkostninger markant. Få demonstreret en løsn der er fire gange mere skalerbar end den seneste VWware, og som kan understøtte op  til 128 virtuelle CPUer per virtuel maskine - endda til en brøkdel af omkostningen. Steen Schmidt fortæller alt om mulighederne i jeres storagesystem V. Erik Lund, Storage Presales-arkitekt, Oracle Lyder det for godt til at være sandt? Det kan faktisk lade sig gøre. Erik Lund fortæller alt om de nyeste storage-teknologier, der åbner op for skalerbarhed på både disc- og controllerniveau, og for database-komprimering med op til faktor 50. Det reducerer behovet for discs og formindsker jeres backup-vindue markant. Kombineret med markedets højeste udnyttelsesgrad og omkostningsfri QoS, giver det helt nye muligheder. Dagen starter kl 8.30 med morgenmad og slutter kl 14.00 Jeg håber I har lyst til at deltage samt at invitere jeres kunder.I skulle gerne have modtaget en invitation som I også kan bruge til at sende ud til jeres kunder.Er det ikke tilfældet så send mig endeligt en mail. Du kan også tilmelde dig via dette link: http://www.woho.dk/oracle og indtaste billetnummer: 1500Mvh Thomas Stenvald

    Read the article

  • Book review: Peopleware: Productive Projects and Teams

    - by DigiMortal
       Peopleware by Tom DeMarco and Timothy Lister is golden classic book that can be considered as mandatory reading for software project managers, team leads, higher level management and board members of software companies. If you make decisions about people then you cannot miss this book. If you are already good on managing developers then this book can make you even better – you will learn new stuff about successful development teams for sure. Why peopleware? Peopleware gives you very good hints about how to build up working environment for project teams where people can really do their work. Book also covers team building topics that are also important reading. As software developer I found practically all points in this book to be accurate and valid. Many times I have found my self thinking about same things and Peopleware made me more confident about my opinions. Peopleware covers also time management and planning topics that help you do way better job on using developers time effectively by minimizing the amount of interruptions by phone calls, pointless meetings and i-want-to-know-what-are-you-doing-right-now questions by managers who doesn’t write code anyway. I think if you follow suggestions given by Peopleware your developers are very happy. I suggest you to also read another great book – Death March by Edward Yourdon. Death March describes you effectively what happens when good advices given by Peopleware are totally ignored or worse yet – people are treated exactly opposite way. I consider also Death March as golden classics and I strongly recommend you to read this book too. Table of Contents Acknowledgments Preface to the Second Edition Preface to the First Edition Part 1: Managing the Human Resource Chapter 1: Somewhere Today, a Project Is Failing Chapter 2: Make a Cheeseburger, Sell a Cheeseburger Chapter 3: Vienna Waits for You Chapter 4: Quality-If Time Permits Chapter 5: Parkinson's Law Revisited Chapter 6: Laetrile Part II: The Office Environment Chapter 7: The Furniture Police Chapter 8: "You Never Get Anything Done Around Here Between 9 and 5" Chapter 9: Saving Money on Space Intermezzo: Productivity Measurement and Unidentified Flying Objects Chapter 10: Brain Time Versus Body Time Chapter 11: The Telephone Chapter 12: Bring Back the Door Chapter 13: Taking Umbrella Steps Part III: The Right People Chapter 14: The Hornblower Factor Chapter 15: Hiring a Juggler Chapter 16: Happy to Be Here Chapter 17: The Self-Healing System Part IV: Growing Productive Teams Chapter 18: The Whole Is Greater Than the Sum of the Parts Chapter 19: The Black Team Chapter 20: Teamicide Chapter 21: A Spaghetti Dinner Chapter 22: Open Kimono Chapter 23: Chemistry for Team Formation Part V: It't Supposed to Be Fun to Work Here Chapter 24: Chaos and Order Chapter 25: Free Electrons Chapter 26: Holgar Dansk Part VI: Son of Peopleware Chapter 27: Teamicide, Revisited Chapter 28: Competition Chapter 29: Process Improvement Programs Chapter 30: Making Change Possible Chapter 31: Human Capital Chapter 32:Organizational Learning Chapter 33: The Ultimate Management Sin Is Chapter 34: The Making of Community Notes Bibliography Index About the Authors

    Read the article

  • I'm a C Programmer, but I can't find a comfortable environment to work in

    - by Jesse Brands
    Hello everyone, Last time I asked a question, I was having issues dealing with Java which I had to do for a course work. I generally use C for my development work - especially personal projects - and I've grown up in what is pretty much a Linux/UNIX world. In this world, it was easy to use C, you had your C compiler (GCC is excellent in that regard) and a wealth of tools such as the command line and vi/emacs/whatever-you-got. However, that was all that I really liked about Linux/UNIX. It really fitted well with the C language; nowadays, I'm somewhat forced into Windows/Mac OS X for most of my work. C seems poorly supported on a mac for starters, there's no GUI API to use and pretty much you get forced into Obj-C. This is not a problem, I like Objective-C, but it's another language I have to learn. Now coming to Windows. Why does everything about Windows Development try to scare me away? It's basically come down to: USE C# AND .NET OR DIE. I don't like C#, I like C, they are fundamentally different. Yet when I make a Windows Forms application in MSVC++ (I know that's not C), I get a main function riddled with weird things I've never heard of before, along with a poor, barely-compliant C/C++ compiler. What am I to do when I just want to program in C, make applications that look and feel like native Windows applications (I am a sucker for aesthetics, and I'm not looking to make something cross-platform. I just want it to work on Windows, and look as native as possible.). C++ is a fine alternative, but it really looks like the only way to make a decent, native feeling Windows application, is to use C#. Am I missing something here? I'd rather not use CYGWIN. Like I said, I want people to install the program, and it should just work out of the box on Windows 7. Program in question involves a Media Player, if anyone is curious what I'm targetting at. Anyone who had the same experiences who can help me out? How can I code something in ANSI C and still have a native feel?

    Read the article

  • Turn-Based RPG Battle Instance Layout For Larger Groups

    - by SoulBeaver
    What a title, eh? I'm currently designing a videogame; a turn-based RPG like Final Fantasy (because everybody knows Final Fantasy). It's a 2D sprite game. These are my ideas for combat: -The player has a group of 15 members (main character included) -During battle, five of the group are designated as active, and appear in the battle. -These five may be switched out at leisure, or when one of the five die. -At any time, the Waiting members can cast buffs, be healed by the active members, or perform special attacks. -Battles should contain 10+ monsters at least. I'm aiming for 20, but I'm not sure if that's possible yet. -Battles should feel larger than normal due to the interaction of Waiting members, active members and the increased amount of monsters per battle. -The player has two rows in which to put the Active members: front and back. -Depending on the implementation, I might allow comboing of player attacks and skills. These are just design ideas, so beware! I have not been able to test this out yet- I have no idea yet if any of these ideas bunched together will make for a compelling game. What sounds good on paper doesn't necessarily have to be good in practice! What I'm asking now is how to create the layout for this. My starting point are the battles in Final Fantasy VI, with up to 5-6 monsters on the left and the characters on the right- monsters on both sides if it's a pincer attack. However, this view would not work feasible with my goal of 20 monsters and 5 characters. All the monsters on the left would appear cluttered unless I scale them far far back. If I create a pincer-like map, then there would be no real pincer-attack possible. If I space the monsters out I force the player to scroll the screen- a game mechanic I've come across and not enjoyed imho. My question is: does anybody have any layouts or guides for designing battle maps in turn-based RPGs, especially with a larger number of enemies taken into consideration? How should it look? I am not asking for specific combat mechanics, just the layout for the moment.

    Read the article

  • AWStats consumes too much resource, how to disable temporarily

    - by trante
    For some days AWStats takes %10-%20 of my CPU, takes 400-550 MB RAM and works for hours. Maybe my site's traffic became larger so process time takes more time than before or some bugs in program makes this. Anyway I want to disable AWStats temporarily. Maybe I would want to activate it in future. I found that answer. But it gives commands to remove AWStats. I only want to disable it temporarily. My system is Centos 6.3, Plesk 11.5.30 Update #19. I tried to disable cron jobs. I run this # killall awstats.pl I opened # vi /etc/cron.daily/awstats file and I changed it to this: #!/bin/sh #/usr/share/awstats/awstats_updateall.pl now -awstatsprog=/var/www/cgi-bin/awstats/awstats.pl -configdir=/etc/awstats >/dev/null 2>&1 exit 0 After some time I still see that awstats is running. What should I do more to not to awstats run again ? But without removing my files. After changing " /etc/cron.daily/awstats" file awstats doesn't start in daytime. But every night in 03:15 awstats starts again. Because of Plesk auto updates are working at that time, I changed from Plesk. Don't auto update automatically. But it seems like last night at 03:15 awstats started again. Is there any way to stop awstats temporarily except this solution ? Because this solution deletes awstats configs permanently and I don't know how to revert it back in future ? Turn off all AWStats for Plesk 11+ domains #!/bin/bash for i in /var/www/vhosts/*; do echo "Turning off and deleting Stats for" echo `basename $i` /usr/local/psa/admin/bin/webstatmng --unset-configs --stat-prog=awstats --domain-name=`basename $i` /usr/local/psa/admin/bin/webstatmng --clean --stat-prog=awstats --domain-name=`basename $i` done

    Read the article

  • How to use cyg-wrapper to fork a new tab in win32 gvim

    - by Peter Nore
    I would like to set up an alias in my cygwin .bashrc that translates pathnames unix-to-dos and passes them to windows gvim in a new tab of an existing instance. I am trying to use Luc Hermitte's cyg-wrapper script for running native win32 applications from Cygwin as per this vim tip. Luc's example of how to use his script is: alias vi= 'cyg-wrapper.sh "C:/Progra~1/Edition/vim/vim63/gvim.exe" --binary-opt=-c,--cmd,-T,-t,--servername,--remote-send,--remote-expr' I do not understand this example because most of these vim parameters (-c,--cmd,--servername,--remote-send,--remote-expr, etc) require more information, and I have not found any example of how to supply the additional information to cyg-wrapper.sh. For example, calling C:/Progra~1/Edition/vim/vim63/gvim.exe --servername=GVIM --remote-tab-silent file1 & will open file1 in a new tab of existing (or non existing) instance GVIM, but calling gvim --servername accomplishes nothing on its own. Unfortunately, though, the corresponding cyg-wrapper phrase does not work: cyg-wrapper.sh "C:/Progra~1/Edition/vim/vim63/gvim.exe" --binary-opt=--servername=GVIM,--remote-tab-silent --fork=2 file1 If ran twice, this actually opens up two instances of gvim; it is as if the servername 'GVIM' is being stripped and ignored. How do you supply a servername to gvim --servername or a .vimrc to gvim -u using cyg-wrapper.sh? Furthermore, why is it that programs must be passed to cyg-wrapper.sh in the relatively obscure "mixed form?" For example, if I try cyg-wrapper.sh "/cygdrive/c/path/to/GVimPortable.exe" --binary-opt=--servername=GVIM,--remote-tab-silent --fork=2 I get "Invalid switch - "/cygdrive"." See also: getting-gvim-to-automatically-translate-a-cygwin-path alias-to-open-gvim-cream-version-from-cygwin-shell

    Read the article

  • NGINX MIME TYPE

    - by justanotherprogrammer
    I have my nginx conf file so that when ever a mobile device visits my site the url gets rewritten to m.mysite.com I did it by adding the following set $mobile_rewrite do_not_perform; if ($http_user_agent ~* "android.+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino") { set $mobile_rewrite perform; } if ($http_user_agent ~* "^(1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-)") { set $mobile_rewrite perform; } if ($mobile_rewrite = perform) { rewrite ^ http://m.mywebsite.com redirect; break; } I got it from http://detectmobilebrowsers.com/ IT WORKS.But none of my images/js/css files load only the HTML. And I know its the chunk of code I mentioned above because when I remove it and visit m.mywebsite.com from my mobile device everything loads up.So this bit of code does SOMETHING to my css/img/js MIME TYPES. I found this out through the the console error messages from safari with the user agent set to iphone. text.cssResource interpreted as stylesheet but transferred with MIME type text/html. 960_16_col.cssResource interpreted as stylesheet but transferred with MIME type text/html. design.cssResource interpreted as stylesheet but transferred with MIME type text/html. navigation_menu.cssResource interpreted as stylesheet but transferred with MIME type text/html. reset.cssResource interpreted as stylesheet but transferred with MIME type text/html. slide_down_panel.cssResource interpreted as stylesheet but transferred with MIME type text/html. myrealtorpage_view.cssResource interpreted as stylesheet but transferred with MIME type text/html. head.jsResource interpreted as script but transferred with MIME type text/html. head.js:1SyntaxError: Parse error isaac:208ReferenceError: Can't find variable: head mrp_home_icon.pngResource interpreted as image but transferred with MIME type text/html. M_1_L_289_I_499_default_thumb.jpgResource interpreted as image but transferred with MIME type text/html. M_1_L_290_I_500_default_thumb.jpgResource interpreted as image but transferred with MIME type text/html. M_1_default.jpgResource interpreted as image but transferred with MIME type text/html. default_listing_image.pngResource interpreted as image but transferred with MIME type text/html. here is my whole nginx conf file just incase... worker_processes 1; events { worker_connections 1024; } http { include mime.types; include /etc/nginx/conf/fastcgi.conf; default_type application/octet-stream; sendfile on; keepalive_timeout 65; #server1 server { listen 80; server_name mywebsite.com www.mywebsite.com ; index index.html index.htm index.php; root /srv/http/mywebsite.com/public; access_log /srv/http/mywebsite.com/logs/access.log; error_log /srv/http/mywebsite.com/logs/error.log; #---------------- For CodeIgniter ----------------# # canonicalize codeigniter url end points # if your default controller is something other than "welcome" you should change the following if ($request_uri ~* ^(/main(/index)?|/index(.php)?)/?$) { rewrite ^(.*)$ / permanent; } # removes trailing "index" from all controllers if ($request_uri ~* index/?$) { rewrite ^/(.*)/index/?$ /$1 permanent; } # removes trailing slashes (prevents SEO duplicate content issues) if (!-d $request_filename) { rewrite ^/(.+)/$ /$1 permanent; } # unless the request is for a valid file (image, js, css, etc.), send to bootstrap if (!-e $request_filename) { rewrite ^/(.*)$ /index.php?/$1 last; break; } #---------------------------------------------------# #--------------- For Mobile Devices ----------------# set $mobile_rewrite do_not_perform; if ($http_user_agent ~* "android.+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino") { set $mobile_rewrite perform; } if ($http_user_agent ~* "^(1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-)") { set $mobile_rewrite perform; } if ($mobile_rewrite = perform) { rewrite ^ http://m.mywebsite.com redirect; #rewrite ^(.*)$ $scheme://mywebsite.com/mobile/$1; #return 301 http://m.mywebsite.com; #break; } #---------------------------------------------------# location / { index index.html index.htm index.php; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } location ~ \.php$ { try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_script_name; include /etc/nginx/conf/fastcgi_params; } }#sever1 #server 2 server { listen 80; server_name m.mywebsite.com; index index.html index.htm index.php; root /srv/http/mywebsite.com/public; access_log /srv/http/mywebsite.com/logs/access.log; error_log /srv/http/mywebsite.com/logs/error.log; #---------------- For CodeIgniter ----------------# # canonicalize codeigniter url end points # if your default controller is something other than "welcome" you should change the following if ($request_uri ~* ^(/main(/index)?|/index(.php)?)/?$) { rewrite ^(.*)$ / permanent; } # removes trailing "index" from all controllers if ($request_uri ~* index/?$) { rewrite ^/(.*)/index/?$ /$1 permanent; } # removes trailing slashes (prevents SEO duplicate content issues) if (!-d $request_filename) { rewrite ^/(.+)/$ /$1 permanent; } # unless the request is for a valid file (image, js, css, etc.), send to bootstrap if (!-e $request_filename) { rewrite ^/(.*)$ /index.php?/$1 last; break; } #---------------------------------------------------# location / { index index.html index.htm index.php; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } location ~ \.php$ { try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_script_name; include /etc/nginx/conf/fastcgi_params; } }#sever2 }#http I could just detect the mobile browsers with php or javascript but i need to make the detection at the server level so that i can use the 'm' in m.mywebsite.com as a flag in my controllers (codeigniter) to serve up the right view. I hope someone can help me! Thank you!

    Read the article

  • Menu tab completion for recent history in zsh

    - by dat5h
    I am interested in a potential zle widget for zsh. Is there a way to build a widget that mimics the kill-completion selectable menu? Essentially I want to be able to press , tab in vi-command-mode, or maybe !-tab-completion at the shell and get a list of recent history (or related history compared what is already entered at the commandline) that allows me to scroll through it and possibly select a relevant function to call or compare similar calls. Looking through the manual I stumbled onto a similar widget that I have mapped like so: # tab completion history menu (vicmd) autoload -z history-beginning-search-menu zle -N history-beginning-search-menu-space-end history-beginning-search-menu bindkey -M vicmd "\t" history-beginning-search-menu-space-end # emacs binding could be "\e\t"? (I wouldn't know) Therefore, if I enter vicmd and hit tab when I enter something like "grep", then I get a list of all grep calls in history. It also asks me for the list-number and it will perform the numbered item in history. If I enter a space and then try this, it lists ALL of my history history. This is fairly close to what I want, but there are some problems. For example, 1) it prints the entire list of relevant history and does not check the number of lines of the screen so it could easily blow up the space on the terminal; 2) when I type in numbers for selecting an item in history it does not show me the numbers I type, so I may make a mistake and have to start over again; 3) I would love to be able to hook in appearance tweaks. I was wondering if there exists more updated version of this widget or if there is any way to look at the source for kill-completion or history-beginning-search-menu to see if I could think of a way to do it.

    Read the article

  • Setting up AJP with JBoss 7

    - by purlogic
    I have two different versions of JBoss on a server, JBoss 6.0 Final and JBoss 7.0.2. I can one run or the other by switching a couple of sym links and issuing a "service jboss start" command. I am, by no means, an expert in JBoss, however JBoss 6.0 appears to have AJP running out of the box with no initial configuration required on port 8009. With JBoss 7, however, I had to vi the file "standalone/configuration/standalone.xml" and add a few entries. Those entries are: In the <subsystem /> tag, I added: <connector name="ajp" protocol="AJP/1.3" socket-binding="ajp" /> In the <socket-binding-group /> tag I added: <socket-binding name="ajp" port="8009"/> Then in Apache's configuration file (httpd.conf), I added: <Proxy *> AddDefaultCharset Off Order deny,allow Allow from all </Proxy> ProxyPass /app ajp://localhost:8009/app ProxyPassReverse /app ajp://localhost:8009/app AJP proxying works with 6, not with 7... I assume it's because I haven't properly set up AJP in JBoss 7 and not entirely sure how to do that. I have searched documentation on their site with not a lot of specifics on how to do so. Any help or insight into setting up AJP with JBoss 7 would be much appreciated!!

    Read the article

  • Postfix: change sender in queued messages

    - by ring0
    Following a complete re-installation we got a problem with the configuration: the sender address was wrong and some recipients (mail servers) rejected them. So there is a bunch of mails stuck in the Postfix queue. Ideally, a change of the sender address directly in the queued mails, and then flushing the queue would be optimal. I tried this answer that addresses this very problem. But messages don't seem to be easily modifiable in the version I have (2.11.0). For instance there is no /var/spool/mqueue dir, but, instead, /var/spool/postfix/... active bounce corrupt defer deferred dev etc flush hold incoming lib maildrop pid private public saved trace usr and the dir of interest is deferred. I tried to modify a few files there changing the wrong domain with the correct one (and was careful to ensure only those were changed). But then, those mails were moved to corrupt, meaning that a simple text change doesn't seem to work (done with vi). Any other cleaner way to change the sender in queued mails?

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26  | Next Page >